Google Sheets SUMIF function
Adds the values in a range that meet one condition.
Syntax
=SUMIF(range, criterion, [sum_range])
range | The cells to test against the criterion. |
|---|---|
criterion | The condition, such as "East", ">100" or a cell reference. |
sum_range | Optional. The cells to add up. If left out, range itself is added. |
Try it
Edit the formula and the result updates instantly. Click a cell to add its reference.
Q1 sales
Result: 1095
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Rep | Region | Product | Units | Revenue |
| 2 | Ana | East | Pens | 120 | 240 |
| 3 | Ben | West | Paper | 80 | 400 |
| 4 | Cara | East | Paper | 45 | 225 |
| 5 | Dev | North | Pens | 200 | 400 |
| 6 | Ana | East | Ink | 30 | 450 |
| 7 | Ben | West | Pens | 95 | 190 |
| 8 | Cara | East | Ink | 12 | 180 |
| 9 | Dev | North | Paper | 60 | 300 |
Examples
These use the sample sheet above.
→ 1095
Total revenue from the East region.
→ 320
Total units from rows that sold more than 100.
→ 690
Use a cell as the criterion: everything Ana sold.
Tips & common mistakes
- Put comparisons in quotes: ">100", "<>Pens". To compare with a cell, join them: ">"&H1.
- range and sum_range should be the same size and line up row for row.
- For more than one condition, use SUMIFS.