-
Notifications
You must be signed in to change notification settings - Fork 294
Open
Description
I noticed the following issues with AVERAGEIF and SUMIF not behaving like the implementation in Excel:
- AVERAGEIF / SUMIF assumes the cells are numeric for both the range and criteria. It will not successfully compare to text cells.
- The criteria parameter requires an operator... there is no implied equals.
Given this example spreadsheet...
| A | B | |
|---|---|---|
| 1 | 1 | 1 |
| 2 | -1 | 2 |
| 3 | yes | 3 |
| 4 | no | 4 |
...here's the result of some formulas we could write:
| Formula | Works? | Issue |
|---|---|---|
=AVERAGEIF(A1:A2, '>0') |
✅ | none |
=AVERAGEIF(A1:A2, '1') |
❌ | No implied equals |
=AVERAGEIF(A3:A4, 'yes') |
❌ | Fails with text inputs |
A few notes:
- These issues occur whether or not the third optional parameter is used.
- There are a few more minor differences, but I wouldn't consider them as high of a priority, since they are less commonly used. They include:
- this implementation doesn't handle wildcards
- this implementation accepts non-range values, whereas the implementations used in excel and google sheets do not.
pawsong and GuyMograbi
Metadata
Metadata
Assignees
Labels
No labels