SUMIF adds numbers that meet a condition. Here is the complete guide — syntax, 6 examples, SUMIFS, common mistakes and FAQ.
SUMIF adds up only the numbers that meet a condition you set. It combines the logic of IF with the adding power of SUM — letting you total a subset of your data without filtering or sorting first.
Common uses: total sales for one region, sum expenses in one category, add up values above a threshold, or total orders for one customer. Any time you want a conditional total, SUMIF is the formula.
=SUMIF(range, criteria, [sum_range])| Argument | Description |
|---|---|
| range required | The column to check the condition against — e.g. the Category column. |
| criteria required | The condition to match — e.g. "North", ">1000", or a cell reference. |
| sum_range optional | The column with the numbers to add. If omitted, SUMIF sums the range column itself. |
=SUMIF(A2:A100, "Coffee", B2:B100)Checks column A for "Coffee" and adds the corresponding values from column B.
=SUMIF(B2:B100, ">1000")Adds all values in B that exceed 1,000. When range and sum_range are the same column you can omit sum_range.
=SUMIF(A2:A100, E1, B2:B100)E1 contains the product name. Change E1 and the sum updates automatically.
=SUMIF(A2:A100, "*coffee*", B2:B100)The * wildcard matches any text before or after "coffee" — so "Iced Coffee", "Coffee Latte" and "Coffee" all match.
=SUMIF(A2:A100, "<>Refund", B2:B100)<> means "not equal to". This sums everything except refunds.
=SUMIF(B2:B100, ">"&AVERAGE(B2:B100))Combine a comparison operator in quotes with & and a formula to create a dynamic threshold.
SUMIF handles one condition. For two or more conditions use SUMIFS — note the argument order changes: sum_range comes first.
=SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2, ...)
=SUMIFS(C2:C100, A2:A100, "Coffee", B2:B100, "North")In SUMIF, sum_range is the third argument. In SUMIFS, sum_range is the first argument. This trips up almost everyone the first time.
The range and sum_range must be the same size. A2:A100 and B2:B50 won't work correctly. Always use identical row counts.
=SUMIF(A:A, Coffee, B:B) will error. Text criteria always need quotes: "Coffee". Number criteria and cell references do not need quotes.
"Coffee " (with a trailing space) won't match "Coffee". Use TRIM on your data to remove hidden spaces that cause missed matches.
ExcelPro has SUMIF and SUMIFS exercises across every specialist track — realistic business data, instant feedback, free to start.
Try SUMIF exercises →