Add up only the numbers that match your condition. SUMIF is one of the most useful formulas you'll ever learn โ here's everything you need to know.
Imagine you have a list of all your expenses for the month โ groceries, rent, eating out, transport. You want to know how much you spent on food only. You could filter the list and use SUM, or you could write one formula: SUMIF.
SUMIF adds up numbers that meet a condition you set. It's like saying: "only add the numbers where the category says Groceries."
It's one of the most used formulas in Excel โ and once you learn it, you'll use it constantly.
=SUMIF(range, criteria, [sum_range])
Three parts โ here's what each one means:
If your criteria is text, wrap it in double quotes. If it's a number or a cell reference, no quotes needed.
You have a sales log and want to total only the sales for "Coffee".
=SUMIF(A2:A10, "Coffee", B2:B10)
| A โ Product | B โ Sales ($) |
|---|---|
| Coffee | 120 |
| Tea | 85 |
| Coffee | 200 |
| Juice | 60 |
| Coffee | 95 |
| SUMIF result | 415 |
Total all expenses over $100 โ useful for spotting big spends.
=SUMIF(B2:B10, ">100")
Note: when the criteria is a comparison like >100, you still put it in quotes but don't add a third argument โ SUMIF uses the same range for checking and summing.
=SUMIF(B2:B10, "<50")
This is much more flexible โ change the cell and the SUMIF updates automatically.
=SUMIF(A2:A10, E1, B2:B10)
โ E1 contains the product name you want to look up
Use * as a wildcard to match any text that contains a word.
=SUMIF(A2:A10, "*coffee*", B2:B10)
โ matches "Coffee", "Iced Coffee", "Coffee Latte"
=SUMIF(A2:A10, "<>Coffee", B2:B10)
โ <> means "not equal to"
If column A has dates and you want to sum a specific month:
=SUMIF(A2:A100, ">=01/06/2026", B2:B100) - SUMIF(A2:A100, ">=01/07/2026", B2:B100)
Sum all values greater than the average:
=SUMIF(B2:B10, ">"&AVERAGE(B2:B10))
SUMIF handles one condition. When you need two or more, use SUMIFS instead.
=SUMIFS(sum_range, range1, criteria1, range2, criteria2, ...)
Example: total Coffee sales in the North region only:
=SUMIFS(C2:C10, A2:A10, "Coffee", B2:B10, "North")
With SUMIFS, the sum_range comes first โ opposite to SUMIF where it comes last. This trips up almost everyone the first time.
"Coffee" not CoffeeReading about SUMIF is one thing. Actually typing it in a live spreadsheet is how you'll remember it. ExcelPro has 8 SUMIF exercises built from real scenarios โ you type the formula, get instant feedback, and move on when you're right.
Type real formulas in a live spreadsheet. Instant feedback. Free to start.
Try SUMIF exercises โ