ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Conditional math
  3. How to Use SUMIF in Excel

How to Use SUMIF in Excel

By ExcelReady Team·Updated October 30, 2026·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+
  1. What does SUMIF do in Excel?
  2. How to use SUMIF in Excel: step by step
  3. When can you leave out sum_range?
  4. SUMIF criteria examples
  5. How to use a cell as the criteria
  6. Why is SUMIF returning 0 or the wrong total?
  7. When to use SUMIFS instead
  8. Practise it

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:

Excel formula
=SUMIF(range, criteria, [sum_range])
PartWhat it meansExample
rangeThe cells to checkC2:C9 (Category)
criteriaWhat those cells must match"Travel"
sum_rangeThe 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:

ABCD
1EmployeeDepartmentCategoryAmount
2AmirSalesTravel420
3BethMarketingMeals85
4ChenSalesMeals62
5DanaITSoftware299
6AmirSalesTravel310
7BethMarketingTravel540
8ChenSalesSoftware120
9ElifITTravel275

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:

  1. Click an empty cell, for example G2.
  2. Type =SUMIF( and select C2:C9, the Category column.
  3. Type a comma, then "Travel".
  4. Type a comma and select D2:D9, the Amount column.
  5. Close the bracket and press Enter.
Excel formula
=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:

Excel formula
=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:

QuestionFormulaResult
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:

Excel formula
=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:

Excel formula
=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:

  1. 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.
  2. 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.
  3. Spaces or typos. "Travel " with a trailing space won't match "Travel". Clean the column with TRIM.
  4. Numbers stored as text. SUMIF skips text, so imported amounts may add up to 0. Convert them with VALUE.
  5. Missing quotes. Travel without 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:

Excel formula
=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:

Excel formula
=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).

fx
ABCDEFGH
1
Employee
Department
Category
Amount
2
Amir
Sales
Travel
420
Sales total
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
10
11
12

Tip: Range to check first, then "Sales" in quotes, then the Amount range.

Practise this in a lesson

LessonSUMIFAdd up only the numbers that meet a condition, with and without a separate sum range.Function guideSUMIFAdd up values that meet one condition with SUMIF. Totals by category, person or amount, the argument-order trap, and a live exercise.

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.

Sources

  • SUMIF function - Microsoft Support
  • SUMIFS function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What does SUMIF do in Excel?
  2. How to use SUMIF in Excel: step by step
  3. When can you leave out sum_range?
  4. SUMIF criteria examples
  5. How to use a cell as the criteria
  6. Why is SUMIF returning 0 or the wrong total?
  7. When to use SUMIFS instead
  8. Practise it

Keep reading

Conditional math· 7 min read

COUNTIFS and SUMIFS: Multiple Conditions in Excel

COUNTIFS counts rows that meet several conditions, and SUMIFS adds numbers from those rows. Each condition is a pair: a range, then its criteria. A row counts only if it matches every pair. SUMIFS puts the sum range first: =SUMIFS(E2:E9,A2:A9,"North",C2:C9,"Laptop") totals North laptop revenue.

Conditional math· 7 min read

AVERAGEIF and AVERAGEIFS in Excel

AVERAGEIF averages the numbers in rows that meet one condition: =AVERAGEIF(range, criteria, average_range), for example =AVERAGEIF(B2:B9,"Marketing",D2:D9). AVERAGEIFS handles two or more conditions and puts the numbers to average first: =AVERAGEIFS(D2:D9,B2:B9,"Finance",C2:C9,"Senior"). If no row matches, both return the #DIV/0! error, so check your criteria or wrap the formula in IFERROR.

Conditional math· 7 min read

MAXIFS and MINIFS: Highest and Lowest With Conditions

MAXIFS returns the highest number among the rows that meet one or more conditions, and MINIFS returns the lowest. Both put the numbers first, then range/criteria pairs: =MAXIFS(D2:D9,B2:B9,"Marketing") finds the top Marketing salary. They need Excel 2019 or newer. If nothing matches, they return 0, not an error.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free