Excel SUMIF Function Explained With Examples
The Excel SUMIF function adds up only the numbers that meet a condition you set. Instead of adding a whole column by hand, you tell Excel which rows to include and which numbers to add. For example, you can total all sales for one product, all expenses in one month, or all scores above a pass mark. This guide explains the syntax, then works through real examples you can copy into your own spreadsheet.
Excel SUMIF Function Syntax
The syntax is: =SUMIF(range, criteria, [sum_range])
- range is the cells Excel checks against your condition.
- criteria is the condition, such as “Apples”, “>100”, or a cell reference like D1.
- sum_range is the cells to add. If you leave it out, Excel adds the range itself.
Worked Example 1: Total Sales for One Product
Suppose A2:A5 hold product names and C2:C5 hold amounts: Apples 120, Apples 80, Bananas 60, Apples 50. To total only the Apples sales, type: =SUMIF(A2:A5,”Apples”,C2:C5)
Excel checks each row in A2:A5, keeps the three Apples rows, and adds 120 + 80 + 50 = 250. The Bananas row is ignored. If the product name is in cell E1 instead, use =SUMIF(A2:A5,E1,C2:C5) so you can change the product without editing the formula.
Worked Example 2: Numbers Greater Than a Value
To add only amounts over 100 from C2:C5, type: =SUMIF(C2:C5,”>100″)
Only the 120 qualifies, so the result is 120. Note that the comparison and the number go inside quotation marks. Other useful criteria include “>=50” (50 or more), “<100” (under 100), and “<>0” (not zero). Because Excel is case-insensitive in criteria, “apples” and “Apples” match the same rows.
Worked Example 3: Wildcards and Partial Matches
Wildcards let you match part of a text value. =SUMIF(A2:A5,”A*”,C2:C5) adds every row whose product starts with A, which gives 250 here. Use “*apple*” to match any text containing apple, and “???” to match exactly three characters. To match a literal asterisk or question mark, put a tilde before it, such as “~*”.
Worked Example 4: SUMIF With Dates
If B2:B5 hold dates and C2:C5 hold amounts, =SUMIF(B2:B5,”>=”&DATE(2026,10,1),C2:C5) totals amounts dated on or after 1 October 2026. Joining the comparison to the DATE function with & is the reliable way to write date criteria. Do not type a date as plain text inside the criteria unless your regional format matches Excel’s, or the match may fail.
SUMIF vs SUMIFS: Which Should You Use?
Use SUMIF for one condition and SUMIFS for two or more. For example, =SUMIFS(C2:C5,A2:A5,”Apples”,B2:B5,”North”) totals only Apples sold in the North. SUMIFS puts the sum range first, so the argument order is different: =SUMIFS(sum_range, criteria_range1, criteria1, …). If you only need one condition, SUMIF is shorter and easier to read. To see a related function that returns matching rows instead of a total, read our guide to the Excel FILTER function.
Common SUMIF Errors and Fixes
- Result is 0: the criteria does not match anything. Check for extra spaces, a different spelling, or numbers stored as text.
- #VALUE! error: the ranges are different sizes, or the sum range contains text that cannot be added. Make both ranges the same height.
- Wrong total: check that the criteria range and sum range line up row for row, and that the criteria is in quotes when it is text or a comparison.
- Dates not matching: use DATE() with & as shown above, and confirm the cells really contain dates, not text.
SUMIF is available in Excel for Microsoft 365, Excel 2021, Excel 2019, and earlier versions, and in Google Sheets with the same syntax. Excel itself comes with Microsoft 365, which includes the desktop and web versions of Excel.
Frequently Asked Questions
What does the Excel SUMIF function do?
The Excel SUMIF function adds up numbers in a range only when the matching cells meet a condition you set, such as a product name, a date, or a value greater than a number.
What is the SUMIF formula syntax?
The syntax is =SUMIF(range, criteria, [sum_range]). The range is checked against the criteria, and the sum_range is what gets added. If sum_range is left out, Excel adds the range itself.
Can SUMIF use more than one condition?
No. SUMIF handles one condition only. For two or more conditions, use SUMIFS, which takes the sum range first and then pairs of criteria ranges and criteria.
Why does my SUMIF return 0?
Usually the criteria matches nothing, often because of an extra space, a different spelling, numbers stored as text, or a date stored as text. Check the cells against the criteria exactly.
Can SUMIF add values from another sheet?
Yes. Reference the other sheet in the ranges, for example =SUMIF(Sales!A2:A5,”Apples”,Sales!C2:C5). The ranges must still be the same size and shape.
[…] and Sheets, our guide to converting Excel to Google Sheets explains the steps, and our guide to the Excel SUMIF function shows another useful formula for working with numbers in a […]