SUMIF
sums cells that match a condition · from excel · excel: not yet compared · sheets: not yet compared
signature
SUMIF(range, criteria, [sum_range])
returns: number
| argument | required |
|---|---|
| range | required |
| criteria | required |
| sum_range | optional |
examples
formula and result, taken from the engine's own test suite — every result below is asserted in CI, not written by hand.
| A | |
|---|---|
| 1 | 10 |
| 2 | 20 |
| 3 | 30 |
fx
=SUMIF(A1:A3, ">15") 50 | A | B | |
|---|---|---|
| 1 | 10 | 2 |
| 2 | 20 | 4 |
| 3 | 30 | 6 |
| 4 | 40 | 8 |
| 5 | 50 | 10 |
fx
=SUMIF(A1:A5, "apple", B1:B5) 0