Excel SUMIF Function: Syntax, 5 Examples and Fixes for Wrong Totals
SUMIF adds up only the numbers that meet a condition. Total sales for one region, expenses for one category, hours for one client: instead of filtering and reading a status bar, you write one formula and it stays correct when the data changes. This guide shows the syntax, five practical examples, the wildcard and operator tricks, and the mistakes that cause wrong totals.
What SUMIF does and its syntax
The function has three parts: =SUMIF(range, criteria, [sum_range]). The range is where Excel looks for your condition. The criteria is the condition itself. The sum_range is the column of numbers to add. If you leave sum_range out, Excel adds the cells in the range itself, which only makes sense when you are testing the numbers directly, for example adding every value above 100.
Imagine a sales table with Region in column A, Product in column B and Amount in column C, from row 2 to row 200. To total the sales for the North region, type =SUMIF(A2:A200,"North",C2:C200). Excel checks each cell in A2:A200, and wherever it finds North it adds the matching cell from C2:C200. The range and sum_range must be the same size and start on the same row, or the totals will be shifted and wrong.
Five examples you can copy
| Goal | Formula | Result |
|---|---|---|
| Sales for one region | =SUMIF(A2:A200,"North",C2:C200) | Adds amounts where region is North |
| Sales for the region typed in cell F1 | =SUMIF(A2:A200,F1,C2:C200) | Change F1 and the total updates |
| All amounts above 500 | =SUMIF(C2:C200,">500") | No sum_range needed |
| Everything except one product | =SUMIF(B2:B200,"<>Laptop",C2:C200) | Adds every product that is not Laptop |
| Products starting with Pro | =SUMIF(B2:B200,"Pro*",C2:C200) | Wildcard matches Pro, Pro Max, Pro Plus |
The second example is the one to remember. Putting the criteria in a cell means you build the formula once and reuse it for every region by typing a different name. Put region names in a column, write the formula next to the first one, and drag it down to get a summary table in a minute.
Operators and wildcards in the criteria
Comparison operators go inside quotation marks along with the number: ">500", "<=100", "<>0". To compare against a number stored in a cell, join the operator and the cell with an ampersand, like =SUMIF(C2:C200,">"&F2). Forgetting the ampersand is the most common reason a threshold formula returns zero.
Two wildcards work with text. The asterisk stands for any number of characters, so "*phone*" matches iPhone, Phone case and Smartphone. The question mark stands for exactly one character, so "A?" matches A1 and AB but not ABC. If you need to find an actual asterisk or question mark, put a tilde in front of it, like "~*".
Sum with dates
Dates are numbers, so the same operators work. To total amounts after the first of March, use =SUMIF(D2:D200,">"&DATE(2026,3,1),C2:C200). To total everything up to today, use "<="&TODAY(). When you need a date range with a start and an end, one condition is not enough: use SUMIFS, the version with several conditions, which we cover next.
SUMIF or SUMIFS?
SUMIF has one condition. SUMIFS has as many as you need, and the sum range comes first: =SUMIFS(C2:C200,A2:A200,"North",B2:B200,"Laptop") adds sales that are both North and Laptop. If you already know you will need a second condition, start with SUMIFS, because it also works with a single condition and you will not have to rewrite later. The order of arguments differs between the two functions, which trips up many people who switch between them.
Common mistakes and fixes
| Problem | Likely cause | Fix |
|---|---|---|
| Result is zero | Numbers stored as text, or missing ampersand in the criteria | Convert the text to numbers, and write ">"&F2 instead of ">F2" |
| Total is too small | Extra spaces in the text, such as "North " | Clean the column with TRIM or fix the entries |
| #VALUE! error | Range and sum_range sizes do not match, or a closed workbook is referenced | Make both ranges the same size and open the other file |
| Wrong rows added | Ranges start on different rows | Both ranges must start on the same row |
| Case matters to you | SUMIF ignores upper and lower case | Use SUMPRODUCT with EXACT for case-sensitive totals |
When a total looks wrong, check it by filtering the table on the same condition and reading the sum in the status bar. If the two numbers differ, the cause is nearly always spaces, text numbers or mismatched ranges, not the function.
Where to go next
SUMIF becomes easier once you are comfortable with the basics in our 15 Excel formulas for beginners. After it, summarize large tables faster with an Excel pivot table, and speed up your editing with the keyboard shortcut cheat sheet. If you prefer a structured course, a full beginner-to-advanced Excel course on Udemy is a good next step (Udemy Excel courses, affiliate link: we earn a commission if you buy through it, at no extra cost to you).
Frequently asked questions
Is SUMIF case sensitive? No. "north" and "North" are treated as the same text.
Can SUMIF use more than one condition? Not directly. Use SUMIFS, or add two SUMIF results together when you want either of two values.
Does SUMIF work in Google Sheets? Yes, with the same syntax and the same wildcards.
Why does my SUMIF return zero? Check for numbers stored as text, a missing ampersand before a cell reference, and extra spaces.
Summary
SUMIF takes a range, a condition and a range to add. Put the condition in a cell so you can reuse the formula, join operators to cell references with an ampersand, use wildcards for partial text matches, and switch to SUMIFS when you need two conditions. Practice on a small sales table with regions and products, and check your first few results against a filter to build trust in the formula.
Related guides: Excel Conditional Formatting: Highlight Duplicates, Overdue Rows and More (With Formulas), Excel Pivot Table Tutorial for Beginners: Build Your First One in 10 Minutes, Excel Formulas for Beginners: 15 Formulas With Examples You Will Use Every Week.
Comments
Post a Comment