Syntax, a live playground, a measured criteria gallery, the optional sum_range trap, and a sourced error library: add cells that meet one condition.
Adds cells that meet one criteria. The criteria argument supports operators and wildcards; sum_range is optional and must match range in size.
SUMIF adds cells that meet one criteria. The criteria argument is where the surprises live: operators, wildcards, and the optional sum_range. Every row was measured live in HyperFormula on the sample table. Click any row to load it.
| Expression | Result | Why |
|---|---|---|
| =SUMIF(A2:A5,"Apple",B2:B5) | 250 | Sum amounts where item is Apple (100+150) |
| =SUMIF(B2:B5,">150") | 500 | 2-arg form: sum the range itself where >150 |
| =SUMIF(B2:B5,">=150") | 650 | Inclusive: 150+200+300 |
| =SUMIF(A2:A5,"*an*",B2:B5) | 200 | Wildcard *an* matches Banana |
| =SUMIF(D2:D5,"East",B2:B5) | 250 | Sum the East region |
| =SUMIF(C2:C5,">10",B2:B5) | 650 | Criteria on qty, sum amount (cross-column) |
| =SUMIF(A2:A5,"<>Apple",B2:B5) | 500 | Not-equal: everything except Apple |
| =SUMIF(B2:B5,"<200") | 250 | Sum values below 200 (100+150) |
The criteria can be a number, text, comparison operator, or wildcard pattern. Measured behavior:
| Criteria | Matches | Note |
|---|---|---|
| "Apple" | exact text | Case-insensitive equality |
| ">150" | numbers > 150 | Operator must be inside the quotes |
| "*an*" | contains "an" | * = any run of characters |
| "?pple" | 5-char "…pple" | ? = exactly one character |
| "<>Apple" | not Apple | <> is the not-equal operator |
SUMIF(range, criteria) sums range itself. SUMIF(range, criteria, sum_range) tests range but sums sum_range — they must be the same size or results misalign.">150", not >150. To use a cell value, concatenate: ">"&E2.Edit the table or type any formula — the engine evaluates instantly. Load a preset to see SUMIF match text, operators and wildcards, and sum a cross-column range.
8 failure patterns mined from actual user reports on Reddit, Stack Overflow and Super User — each with the authentic symptom, root cause, a fix, and a runnable formula. Not textbook theory.
SUMIF is available across modern Excel, Google Sheets and LibreOffice. It has been in Excel since 2003.
| Platform | Support | Notes | Gotcha |
|---|
SUMIF is one piece. The full course walks the toolkit end to end with live, measured examples.