SUMIF with a text criterion
Step 1 of 3
SUMIF adds up only the rows that meet a condition. It takes the range to check, the condition, and the range to add up.
Click Continue when you're ready.
Already know it? Type the formula straight into D2.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Fruit | Units | ||||
| 2 | Apple | 5 | ||||
| 3 | Pear | 3 | ||||
| 4 | Apple | 8 | ||||
| 5 | Plum | 2 | ||||
| 6 | Apple | 4 | ||||
| 7 | ||||||
| 8 |
Need help?
Why this works
SUMIF goes down A2:A6, and wherever the fruit is Apple it adds the number from the same row of B2:B6. The two ranges must be the same size.
Common mistake: Swapping the ranges. The range to check comes first, and the range to add up comes last.
The answer
- D2
=SUMIF(1A2:A6,2"Apple",3B2:B6)
In plain words: Add up 3the units in B2:B6 on the rows where 1the fruit in A2:A6 is 2Apple.
Use =SUMIF(range,"word",sum_range). The range is checked against the word and the matching cells in sum_range are added.
+10 points