How to Use SUMIF in Excel
By ExcelReady TeamUpdated 7 min read
The short answer
SUMIF adds up the numbers in the rows that meet one condition. Write =SUMIF(range, criteria, sum_range): the cells to check, what they must match, then the numbers to add. For example, =SUMIF(C2:C9,"Travel",D2:D9) totals all Travel claims. Leave out sum_range when the condition is about the numbers themselves.
Key takeaways
- The shape is =SUMIF(range, criteria, [sum_range]). The sum range comes last.
- Leave out sum_range to add the same cells you checked, as in =SUMIF(D2:D9,">250").
- Text and operators go in double quotes; cell references don't: ">"&G1.
- Make range and sum_range the same size and start on the same row.
- For two or more conditions, switch to SUMIFS, which puts the sum range first.
On this page+
Excel SUMIF adds up only the numbers that meet a condition, such as every Travel expense or every claim over 250. You write =SUMIF(range, criteria, sum_range): where to look, what to match, and what to add. This guide walks through the syntax, the criteria you'll use most, and the mistakes that make SUMIF return 0, using one small expense table you can copy.
What does SUMIF do in Excel?#
SUMIF checks each row against one condition and adds the numbers from the rows that match. It has three parts:
=SUMIF(range, criteria, [sum_range])| Part | What it means | Example |
|---|---|---|
| range | The cells to check | C2:C9 (Category) |
| criteria | What those cells must match | "Travel" |
| sum_range | The numbers to add (optional) | D2:D9 (Amount) |
The square brackets mean sum_range is optional. SUMIF works in every version of Excel and is not case-sensitive.
The examples use this expense table in A1:D9:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Department | Category | Amount |
| 2 | Amir | Sales | Travel | 420 |
| 3 | Beth | Marketing | Meals | 85 |
| 4 | Chen | Sales | Meals | 62 |
| 5 | Dana | IT | Software | 299 |
| 6 | Amir | Sales | Travel | 310 |
| 7 | Beth | Marketing | Travel | 540 |
| 8 | Chen | Sales | Software | 120 |
| 9 | Elif | IT | Travel | 275 |
How to use SUMIF in Excel: step by step#
To total by category, give SUMIF the Category column to check, the word to match, and the Amount column to add:
- Click an empty cell, for example G2.
- Type
=SUMIF(and select C2:C9, the Category column. - Type a comma, then
"Travel". - Type a comma and select D2:D9, the Amount column.
- Close the bracket and press Enter.
=SUMIF(C2:C9,"Travel",D2:D9)The result is 1,545: 420 + 310 + 540 + 275. SUMIF looked down column C, found four Travel rows, and added their amounts from column D.
When can you leave out sum_range?#
Leave out sum_range when the condition is about the same numbers you want to add. To total every claim over 250:
=SUMIF(D2:D9,">250")SUMIF checks the amounts and adds the ones that pass: 420 + 299 + 310 + 540 + 275 = 1,844. With only two parts, the checked cells and the added cells are the same.
SUMIF criteria examples#
SUMIF uses the same criteria rules as COUNTIF: text and operators in double quotes, numbers and cells without. Here are the common forms on the expense data:
| Question | Formula | Result |
|---|---|---|
| Total Travel | =SUMIF(C2:C9,"Travel",D2:D9) | 1,545 |
| Everything but Travel | =SUMIF(C2:C9,"<>Travel",D2:D9) | 566 |
| Claims over 250 | =SUMIF(D2:D9,">250") | 1,844 |
| Claims of 100 or less | =SUMIF(D2:D9,"<=100") | 147 |
| Employees whose name starts with A | =SUMIF(A2:A9,"A*",D2:D9) | 730 |
Write operators touching the value, with no space: ">250", not "> 250". Not equal to is <>. The * in "A*" is a wildcard that stands for any characters. You'll find more patterns in Excel wildcards in COUNTIF and SUMIF.
How to use a cell as the criteria#
Point the criteria at a cell so one formula fills a whole summary. Put Marketing, IT and Sales in F7:F9, then type this in G7:
=SUMIF($B$2:$B$9,F7,$D$2:$D$9)Select G7:G9 and fill down (Windows: Ctrl+D; Mac: ⌘D). You get 625 for Marketing, 574 for IT and 912 for Sales.
The $ signs lock both ranges, so they stay put as you fill. F7 has none, so it moves to F8 and F9. To add the $ signs quickly, click a reference in the formula and press F4 (Windows) or ⌘T (Mac). To compare against a number in a cell, join the operator with &. If G1 holds 250, =SUMIF(D2:D9,">"&G1) gives the same 1,844 as before.
Always check a summary like this. Every claim belongs to one department, so the three totals should add up to the grand total:
=SUM(G7:G9)=SUM(D2:D9)This shows TRUE when 625 + 574 + 912 equals 2,111. A FALSE means a department is missing or misspelled.
Why is SUMIF returning 0 or the wrong total?#
SUMIF returns 0 when no row matches, and a wrong total when the ranges don't line up. Check these:
- Ranges in the wrong order.
=SUMIF(D2:D9,"Travel",C2:C9)checks the amounts for the word Travel and finds nothing. The range to check comes first. - Ranges of different sizes. Make range and sum_range cover the same rows, like C2:C9 and D2:D9. If they start on different rows, SUMIF adds the wrong cells.
- Spaces or typos. "Travel " with a trailing space won't match "Travel". Clean the column with TRIM.
- Numbers stored as text. SUMIF skips text, so imported amounts may add up to 0. Convert them with VALUE.
- Missing quotes.
Travelwithout quotes gives #NAME?.
When to use SUMIFS instead#
Use SUMIFS when a row must meet two or more conditions, such as Sales and Travel. SUMIFS puts the sum range first:
=SUMIFS(D2:D9,B2:B9,"Sales",C2:C9,"Travel")The result is 730 (Amir's two trips). SUMIFS also handles a range of numbers, using the same column twice. To add the claims from 100 to 300:
=SUMIFS(D2:D9,D2:D9,">=100",D2:D9,"<=300")That gives 299 + 120 + 275 = 694. Dates work the same way, which is how you total a month: see how to sum by date range with SUMIFS.
Mixing up the argument order of SUMIF and SUMIFS is an easy slip to make under time pressure, for example in a job test. SUMIF vs SUMIFS compares them side by side, and COUNTIFS and SUMIFS with multiple conditions goes deeper.
The same pattern works for other summaries. AVERAGEIF gives the average of matching rows, and MAXIFS and MINIFS give the highest and lowest. If you're preparing for a sales or operations role, see the Excel skills sales operations jobs ask for. For a quick syntax reference, open the SUMIF function guide.
Practise it#
Practise SUMIF in a live spreadsheet: total Travel claims, add claims over 250, build a department summary with locked ranges, and check it with a TRUE/FALSE test. Each step tells you exactly what went wrong if your formula doesn't match.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
What did the Sales department claim in total? Click G2 and use SUMIF: check the Department column (B2:B9) and add the Amount column (D2:D9).
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Amount | |||||||
| 2 | Sales total | |||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | ||||||||
| 7 | ||||||||
| 8 | ||||||||
| 9 | ||||||||
| 10 | ||||||||
| 11 | ||||||||
| 12 |
Tip: Range to check first, then "Sales" in quotes, then the Amount range.
Practise this in a lesson
Frequently asked questions
What is the difference between SUMIF and SUMIFS?
SUMIF takes one condition and puts the sum range last. SUMIFS takes one or more conditions and puts the sum range first: =SUMIFS(sum_range, range1, criteria1, ...).
Can SUMIF work without a sum range?
Yes. If you leave out sum_range, SUMIF adds the cells it checked. =SUMIF(D2:D9,">250") adds every amount over 250.
Why is my SUMIF returning 0?
Nothing matched the criteria, or the numbers are stored as text. Check the spelling and spaces in the criteria, the quotes, and whether the amounts sit on the left of their cells, which suggests text.
Can SUMIF add numbers that contain a word?
Yes, with wildcards. =SUMIF(B2:B9,"Sales",D2:D9) adds the amounts where column B contains Sales anywhere in the text.
Is SUMIF case-sensitive?
No. SUMIF treats travel, Travel and TRAVEL as the same text.