Conditional function
Excel SUMIF function
SUMIF adds up the numbers in rows that meet one condition. Use it to total spending in one category, sales for one rep, or every expense over $100. For several conditions, use SUMIFS.
=SUMIF(range, criteria, [sum_range])Arguments
range- The cells to test against the condition.
criteria- The condition, like "Groceries" or ">100". Text and operators go in quotes.
sum_range- Optional. The cells to add up. Leave it out to sum the range itself.
SUMIF examples
Every result below was calculated live from this sample sheet.
| A | B | C | |
|---|---|---|---|
| 1 | Date | Category | Amount |
| 2 | 2025-06-02 | Groceries | 84.2 |
| 3 | 2025-06-03 | Fuel | 52 |
| 4 | 2025-06-05 | Dining out | 46.5 |
| 5 | 2025-06-07 | Groceries | 121.35 |
| 6 | 2025-06-09 | Utilities | 138 |
| 7 | 2025-06-12 | Groceries | 67.9 |
Result: 273.45
Total grocery spending for the month.
Result: 259.35
No sum_range needed when you test and add the same column. This totals every bill over $100.
Result: 236.5
Everything except groceries.
Result: 46.5
Wildcards work too. This totals categories starting with D.
How to use SUMIF
- Click an empty cell.
- Type =SUMIF( and select the column to test.
- Type a comma and the condition in quotes.
- Type a comma and select the column to add.
- Close the bracket and press Enter.
Common SUMIF mistakes
Arguments in the wrong order
SUMIF puts sum_range last, but SUMIFS puts it first. Double-check when you switch between them.
Condition referencing a cell
Use ">"&E1, not ">E1". The second looks for the literal text E1.
sum_range a different size
Keep both ranges the same height. If they differ, Excel quietly resizes sum_range and can add the wrong cells.
SUMIF FAQ
Why is my SUMIF returning 0?
Usually the criteria never match because of extra spaces or different spelling, or the amounts are stored as text. Check one row by hand.
How do I use SUMIF with multiple criteria?
Use SUMIFS, which accepts several range and condition pairs. For an OR, add two SUMIFs together.
Can SUMIF sum cells that contain certain text?
Yes. Use wildcards in the condition, like =SUMIF(B2:B20,"*coffee*",C2:C20).
Practice SUMIF in these lessons
Guides that use SUMIF
- How to calculate percentage of total in Excel
- How to sum if a cell contains text in Excel
- SUMIFS with multiple criteria in Excel
- Excel formulas cheat sheet: the 25 everyone should know
Related functions
SUMIFSAdds with several conditionsCOUNTIFCounts cells that matchAVERAGEIFAverages cells that matchSUMAdds numbers
Updated 2026-10-31