Example 1
Total for one region
B9 =SUMIF(A2:A7,"North",B2:B7)
Result: 2550
SUMIF tests A2:A7 for "North" and adds the matching cells of B2:B7: 1,200 + 950 + 400.
B9 =SUMIF(A2:A7,"North",B2:B7) returns 2550
Adds the cells that meet one condition, such as every sale in a region or every amount over a limit.
Syntax
=SUMIF(, , )
All versions of Excel.
Try it
Edit the formula in B9 or change the inputs. The sheet recalculates as you type.
B9 =SUMIF(A2:A7,"North",B2:B7) returns 2550
SUMIF adds the values that meet a single condition. Use it for questions like "how much did the North region sell?" or "what is the total of all invoices over 700?".
SUMIF looks down the range one cell at a time and tests each against the criteria. When a cell passes, SUMIF adds the cell in the same position of sum_range. If you leave sum_range out, SUMIF adds the cells in range themselves, which is the usual choice when the condition is on the numbers: =SUMIF(B2:B9, ">700").
"north" finds "North".">=500", "<100", "<>North".* stands for any run of characters and ? for any single character: "Desk*" matches "Desk lamp" and "Desk chair". To search for a literal * or ?, put ~ in front of it.&: ">="&E2. Typing ">=E2" instead is a common slip, because Excel then compares against the text "E2".In SUMIF the cells to add come last and are optional. In SUMIFS they come first and are required. Copying a formula between the two without moving the argument is a frequent source of wrong totals.
SUMIF handles one condition. For two or more, for example region and month, use SUMIFS. For an OR condition across different columns, add two SUMIFs, or use SUMPRODUCT.
#N/A makes the whole result #N/A.Lock the ranges with dollar signs, as in $A$2:$A$9, when you copy a SUMIF down a list of regions.
A2:A9. If you leave out sum_range, these cells are also the ones that get added."North" matches text, and a string such as ">500", "<>North" or "Desk*" uses an operator or wildcard. To use a cell as the limit, join it on: ">"&E2.B2:B9. Give it the same size as range. If it is a different size, Excel resizes it from its top-left cell to match range.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
B9 =SUMIF(A2:A7,"North",B2:B7)
Result: 2550
SUMIF tests A2:A7 for "North" and adds the matching cells of B2:B7: 1,200 + 950 + 400.
B9 =SUMIF(A2:A7,"North",B2:B7) returns 2550
Example 2
D2 =SUMIF(B2:B7,">700")
Result: 2950
The condition is on the sales themselves, so sum_range is left out. The cells that pass, 1,200, 800 and 950, are the ones added.
D2 =SUMIF(B2:B7,">700") returns 2950
Example 3
E2 =SUMIF(B2:B7,">"&D2)
Result: 2950
The operator is joined to the cell with &. Change D2 and the total follows.
E2 =SUMIF(B2:B7,">"&D2) returns 2950
Example 4
B8 =SUMIF(A2:A6,"Desk*",B2:B6)
Result: 9
"Desk*" matches any item that starts with Desk: 4 + 2 + 3.
B8 =SUMIF(A2:A6,"Desk*",B2:B6) returns 9
Example 5
B9 =SUMIF(A2:A7,"<>North",B2:B7)
Result: 2100
"<>North" means not equal to North, so South and East are added: 800 + 600 + 700.
B9 =SUMIF(A2:A7,"<>North",B2:B7) returns 2100
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In E2, total the amounts for the category named in D2.
Answer in E2.
">="&D2 written ">=D2", compares against the text "D2" and returns 0. Join the operator to the cell with &."North*".#VALUE!. Shorten it or use SUMPRODUCT.">700". Convert them to real numbers first.SUMIF has one condition and puts the cells to add last. SUMIFS takes any number of conditions and puts the cells to add first. With one condition they give the same answer.
Join the operator and the cell with an ampersand: `=SUMIF(B2:B9, ">"&E2)`. Writing `">E2"` doesn't work, because Excel reads E2 as text.
No. Use SUMIFS for AND conditions, such as region and product. For OR across columns, add two SUMIF results or use SUMPRODUCT.
Yes. "north" and "NORTH" both match "North". For a case-sensitive total, use SUMPRODUCT with EXACT.
Put wildcards either side of the word: `=SUMIF(A2:A9, "*lamp*", B2:B9)` adds every row whose text contains "lamp".
Tracks take you from the basics to modelling, one graded exercise at a time.