The Excel SUMIF function adds up only the cells that meet one condition: sales for one region, amounts above a limit, items that start with a word. The formula is short, but its criteria follow their own rules about quotes, the ampersand and wildcards, and most wrong totals come from there. This guide uses one eight-row sales list, and every result below was worked out by hand from that list, including the mistakes that return a believable but wrong number.

SUMIF syntax
=SUMIF(range, criteria, [sum_range])
range is where the test is applied. criteria is the test. sum_range is what gets added, and it is optional: leave it out and Excel adds the cells in range itself, which is how you total “values above 150” in a single column. Think of it as: find the rows where the range matches, then add the same rows in the sum range.

A worked example
Type this list into A1:D9 of a new sheet (dates as real dates). The total of column D is 1330.
| A: Date | B: Region | C: Product | D: Amount | |
|---|---|---|---|---|
| 2 | 2026-03-02 | East | Pens | 120 |
| 3 | 2026-03-05 | West | Paper | 340 |
| 4 | 2026-03-09 | East | Paper | 210 |
| 5 | 2026-03-14 | North | Pens | 95 |
| 6 | 2026-03-20 | West | Pens | 150 |
| 7 | 2026-03-27 | East | Stapler | 60 |
| 8 | 2026-04-03 | North | Paper | 275 |
| 9 | 2026-04-10 | West | Stapler | 80 |
To total East, test the Region column and add the Amount column: =SUMIF(B2:B9,"East",D2:D9) returns 390 (120 + 210 + 60). Do the same for the other regions and the parts add back to the whole: West 570 (340 + 150 + 80), North 370 (95 + 275), and 390 + 570 + 370 = 1330. When a set of SUMIF totals does not add up to the plain SUM, a row is missing from one of the criteria.
How to write the criteria
Anything with a comparison sign or a word goes inside double quotes. A plain number does not need them. Text is not case-sensitive, and you do not type the equals sign for “is equal to”.
| You want | Formula | Result |
|---|---|---|
| Amounts above 150 | =SUMIF(D2:D9,">150") | 825 (340 + 210 + 275) |
| Amounts of 150 or more | =SUMIF(D2:D9,">=150") | 975 (adds the 150 itself) |
| Amounts equal to 150 | =SUMIF(D2:D9,150) | 150 |
| Every region except East | =SUMIF(B2:B9,"<>East",D2:D9) | 940 (1330 − 390) |
| Products that start with Pen | =SUMIF(C2:C9,"Pen*",D2:D9) | 365 (120 + 95 + 150) |
| East as a share of the total | =SUMIF(B2:B9,"East",D2:D9)/SUM(D2:D9) | 0.2932, which is 29.3% when formatted as a percentage |

Put the criteria in a cell: the ampersand rule
Typing the limit inside the formula works, but a cell is easier to change. Say F1 holds 150. A bare cell reference works for “equal to”: =SUMIF(D2:D9,F1) returns 150. When you also need an operator, join the two with an ampersand: =SUMIF(D2:D9,">"&F1) returns 825, the same as typing “>150”.
The two common slips are ">F1", which makes Excel compare against the text F1 instead of the number in the cell, and "F1" in quotes, which turns the reference into plain text. Neither shows an error. They just return a number you did not mean. The same ampersand rule applies to functions: "<"&TODAY() means “before today”.
Careful with empty criteria cells: if the criteria points at an empty cell, SUMIF reads it as 0 and matches cells that contain 0, not empty cells (Exceljet documents this). To match blanks on purpose, use =SUMIF(A1:A10,F1&"",B1:B10) or the criteria "". For cells that are not blank, use "<>".
Wildcards for partial matches
Two wildcards work in text criteria: * matches any run of characters (including none) and ? matches exactly one. To find a real asterisk or question mark, put a tilde in front of it, as in "*~?". On the sample list:
| Criteria on column C | Matches | Sum of D |
|---|---|---|
"Pen*" | Pens (3 rows) | 365 |
"St*" | Stapler (2 rows) | 140 |
"*er" | Paper and Stapler (5 rows) | 965 (825 + 140) |
"Pen?" | Pens (Pen plus exactly one character, 3 rows) | 365 |
Wildcards are for text. Numbers and dates are compared with the operators above.
Dates as criteria
Dates are numbers, so the same operators apply. Typing a date as text can be read differently depending on regional settings, so build it with DATE or point to a cell. To total April and later: =SUMIF(A2:A9,">="&DATE(2026,4,1),D2:D9) returns 355 (275 + 80). Before April: =SUMIF(A2:A9,"<"&DATE(2026,4,1),D2:D9) returns 975, and 975 + 355 = 1330.
Two conditions, or this or that
SUMIF takes one condition. For “this and that”, switch to SUMIFS, where the sum range comes first: =SUMIFS(D2:D9,B2:B9,"East",D2:D9,">100") returns 330, because only 120 and 210 are East and above 100. A date window needs the same function, one condition per end: =SUMIFS(D2:D9,A2:A9,">="&DATE(2026,3,1),A2:A9,"<"&DATE(2026,4,1)) returns 975, which is every March row.
For “this or that” on the same column, put the choices in curly braces and wrap the whole thing in SUM: =SUM(SUMIF(B2:B9,{"East","North"},D2:D9)) returns 760 (390 + 370). The braces make SUMIF return two totals, and SUM adds them.

Why SUMIF returns the wrong total
The two ranges do not line up. Microsoft’s documentation says the summed cells start at the first cell of sum_range and take the shape of range. Slide the sum range down one row by mistake, =SUMIF(B2:B9,"East",D3:D10), and every row pairs with the amount below it. The East rows (2, 4, 7) now pick up D3, D5 and D8: 340 + 95 + 275 = 710, not 390. No error appears. Keep both ranges the same size and starting on the same row, and lock them with dollar signs ($B$2:$B$9) before copying the formula down.
The argument order of SUMIFS is reversed. SUMIF is range, criteria, sum_range. SUMIFS starts with the sum range. Copying the SUMIF order into SUMIFS will not give the East total.
It is not case-sensitive. "east" and "East" return 390 alike. If case matters, use =SUMPRODUCT(--EXACT(B2:B9,"East"),D2:D9), which returns 390 for “East” and 0 for “east”.
Long text and hidden rows. Microsoft warns that SUMIF gives wrong results when it matches text longer than 255 characters, so shorten the criteria or use SUMPRODUCT. SUMIF also adds hidden and filtered rows like SUM does; for visible-only totals see the SUBTOTAL table in the SUM function guide.

Google Sheets uses the same =SUMIF(range, criterion, [sum_range]) and accepts the same *, ? and tilde wildcards. The ampersand rule is identical. The Sheets documentation also says a text criterion must be in quotation marks.
Frequently asked questions
What does the SUMIF function do in Excel?
It adds the cells in a range that meet one condition. =SUMIF(B2:B9,"East",D2:D9) adds the amounts in column D for every row whose region is East.
How do I use SUMIF with greater than?
Put the operator and the number in quotes: =SUMIF(D2:D9,">150"). If the limit is in a cell, join it with an ampersand: =SUMIF(D2:D9,">"&F1).
Can SUMIF use more than one condition?
No, it takes one. Use SUMIFS for several conditions at once, which accepts up to 127 range and criteria pairs. For an “or” on one column, wrap SUMIF with an array of choices inside SUM.
How do I SUMIF with a wildcard?
Use an asterisk for any run of characters and a question mark for a single character, inside quotes: =SUMIF(C2:C9,"Pen*",D2:D9). Type a tilde before a real asterisk or question mark.
Why does SUMIF return the wrong number or 0?
Check that the criteria range and the sum range have the same size and start on the same row, that operators sit inside quotes, and that cell references are joined with an ampersand. A 0 often means the criteria text does not match exactly, such as a stray space in the data.
Sources: Last checked November 2026. Microsoft Support: SUMIF function, SUMIFS function; Exceljet: SUMIF; Google: SUMIF in Google Sheets.