Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVERAGE function does not behave correctly with no rows #93

Closed
alexiwalker opened this issue Aug 23, 2022 · 1 comment
Closed

AVERAGE function does not behave correctly with no rows #93

alexiwalker opened this issue Aug 23, 2022 · 1 comment

Comments

@alexiwalker
Copy link

alexiwalker commented Aug 23, 2022

If i use a formula of FLOOR(IF(ISERROR(AVERAGE(Sheet1!D2:D)),0,AVERAGE(Sheet1!D2:D)),1) , IE floor of average of a column, or zero if column is an error, the result I get after running the calculation is {t:"n", v:NaN, f:(above), w:"0"}.

The Average function returns a NaN which is not handled by the ISERROR function surrounding it because divide by zero does not throw an exception in JS, while the same operation would give #DIV/0!, and/or be caught by ISERROR in other spreadsheet programs

I can get the result i need by changing it to ISNUMBER instead of ISERROR, but i believe ISERROR + AVERAGE still has incorrect behaviour

fabiooshiro added a commit that referenced this issue Nov 2, 2022
@fabiooshiro
Copy link
Owner

Try the new version v0.7.5
and feel free to reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants