Excel SUMIF function
SUMIF adds up only the rows that meet a condition. The condition can be text, a number, a date or a comparison, and wildcards work. For two or more conditions you need SUMIFS — and its argument order is different, which is where most people go wrong.
Math & conditional sums · Available in: Excel 2007 and later
Syntax
SUMIF(range, criteria, [sum_range])What it returns The total of sum_range across the rows that meet one condition.
| Arguments | ||
|---|---|---|
| range | required | The range to test against the condition. |
| criteria | required | The condition: text and operators in quotes (">900"), or a cell reference. |
| sum_range | optional | The range to add up; omitted means add the range being tested. |
Examples
Only one region's amounts
| Region | Amount |
| North | 1200 |
| South | 800 |
| North | 450 |
= SUMIF(A2:A4,"North",B2:B4)→ 1650
Rows 1 and 3 have North in column A, so their B values, 1200 and 450, are added to give 1650. Text conditions need quotes.
Only the part above a threshold
| Amount |
| 1200 |
| 800 |
| 450 |
= SUMIF(A2:A4,">900")→ 1200
Comparison operators go inside the quotes: ">900". With the third argument omitted the function adds the tested range itself, so only 1200 qualifies.
Common mistakes
- 1.sum_range a different height from range. Excel anchors on the top-left of range and applies the shape, so the answer is shifted but no error appears — keep both ranges the same size.
- 2.Writing the condition as "=North" or as bare North. Unquoted text is read as a name and returns #NAME?.
- 3.Using SUMIF for several conditions. It reads only the first one and treats the rest as sum_range, producing a silently wrong total — use SUMIFS.
- 4.Date conditions typed as "2026-11-20" fail under some regional settings; DATE(2026,11,20) or ">="&DATE(...) is reliable.
How to use it
- 1.Click the cell where the result should appear.
- 2.Type = then the function name, and press Tab to accept it.
- 3.Enter each argument separated by commas; ranges can be dragged with the mouse.
- 4.Press Enter. Drag the fill handle down if the same formula applies to more rows.
Frequently asked questions
What is the syntax of SUMIF?
SUMIF(range, criteria, [sum_range]). What it returns: The total of sum_range across the rows that meet one condition.
Which Excel versions support SUMIF?
Excel 2007 and later. It is available in every desktop version unless the note above says otherwise.
Why does SUMIF return an error instead of a value?
sum_range a different height from range. Excel anchors on the top-left of range and applies the shape, so the answer is shifted but no error appears — keep both ranges the same size.