SUMIF
Adds values that satisfy a single criterion.
SUMIF evaluates each cell in range against criteria, then sums corresponding values.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=SUMIF(range, criteria, [sum_range])
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
range | any | Required | — |
criteria | any | Required | — |
sum_range | any | Optional | — |
Differences from Excel
Excel requires a reference for the optional result range, where Formualizer can evaluate a non-reference expression and propagate its error. Formualizer also accepts array constants as the criteria range, which Excel requires to be a reference.
Remarks
- An equality criterion for a date or number (
"10/26/1999","36459",36459) also matches text cells holding that date;<>and ordering criteria do not read date text. - If
sum_rangeis omitted, matching cells fromrangeare summed. - Criteria support operators like
">10"and wildcard text patterns. - Cells that do not coerce to numbers in the sum target contribute
0.
Examples
Select East records by label and aggregate the corresponding numbers.
Formula =SUMIF(A1:A3,"East",B1:B3)
| A | B | |
|---|---|---|
| 1 | "East" | 10 |
| 2 | "West" | 50 |
| 3 | "East" | 20 |
Expected result 30
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Omit the result range so the criterion and calculation use the same cells.
Formula =SUMIF(C1:C3,">2")
| C | |
|---|---|
| 1 | 2 |
| 2 | 4 |
| 3 | 6 |
Expected result 10
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Aggregate a single row that satisfies the criterion.
Formula =SUMIF(A1:A1,"East",B1:B1)
| A | B | |
|---|---|---|
| 1 | "East" | 10 |
Expected result 10
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Sum values above a threshold
Formula =SUMIF(A1:A3, ">10")
| A | |
|---|---|
| 1 | 5 |
| 2 | 15 |
| 3 | 25 |
Expected result 40
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Use separate sum range
Formula =SUMIF(A1:A3, "East", B1:B3)
| A | B | |
|---|---|---|
| 1 | "East" | 10 |
| 2 | "West" | 40 |
| 3 | "East" | 20 |
Expected result 30
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
What happens when matching cells are non-numeric in SUMIF?
They contribute 0 to the sum target after coercion logic.
Can SUMIF use wildcard criteria like * and ??
Yes. Text criteria support wildcard matching semantics.