∑ifConditional math4 min read ·

SUMIF and SUMIFS in Excel, Explained

How to use SUMIF and SUMIFS to total only the rows that match. Text, numbers, dates, wildcards and several conditions, and why the argument order differs.

Quick answer

=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

SUMIF adds up the cells that meet one condition. SUMIFS adds up cells that meet several conditions at once. In SUMIFS the range to add up comes first.

Arguments in [brackets] are optional.

On this page ⌄
  1. SUMIF: add up with one condition
  2. Writing conditions
  3. SUMIFS: add up with several conditions
  4. Adding up between two dates
  5. Either-or conditions
  6. Common mistakes
  7. Related functions
  8. Key takeaways

SUM adds up everything. Most real questions are more specific than that: revenue for one product, sales in one region, spending in March. SUMIF and SUMIFS answer those questions in a single formula, with no filtering or copying rows around.

The examples use this sales log in A1:F11:

A: DateB: RegionC: RepD: ProductE: UnitsF: Revenue
2Jan 4, 2026NorthAvaLaptop3$3,600
3Jan 9, 2026SouthLeoMonitor5$1,250
4Jan 15, 2026NorthMayaLaptop2$2,400
5Jan 22, 2026EastSamKeyboard12$720
6Feb 3, 2026WestZoeMonitor4$1,000
7Feb 11, 2026NorthAvaKeyboard8$480
8Feb 19, 2026SouthIvyLaptop4$4,800
9Feb 27, 2026EastSamMonitor6$1,500
10Mar 6, 2026WestNoahLaptop1$1,200
11Mar 14, 2026NorthMayaMonitor7$1,750

SUMIF: add up with one condition

=SUMIF(range, criteria, [sum_range])
ArgumentWhat it meansExample
rangeThe cells to check against the conditionD2:D11
criteriaThe condition"Laptop"
sum_rangeThe cells to add up for the rows that matchF2:F11

How much revenue came from laptops?

=SUMIF(D2:D11, "Laptop", F2:F11)→ $12,000

SUMIF walks down D2:D11, and every time it finds "Laptop" it adds the revenue from the same row: 3,600 + 2,400 + 4,800 + 1,200.

When the condition is about the numbers you're adding, you can leave out sum_range. Total revenue from orders over $2,000:

=SUMIF(F2:F11, ">2000")→ $10,800

Try it yourself. The sheet is live, so you can drag across a column to insert the range.

Try it yourself

A live spreadsheet. Type a formula and press Enter to check it.

Exercise 1 of 11SUMIF

What was the total revenue from the North region?

Write your formula in the green cell, I2.

q1-orders.xlsx
fx
1DateRegionRepProductUnitsRevenue
2Jan 4, 2026NorthAvaLaptop3$3,600.00North revenue
3Jan 9, 2026SouthLeoMonitor5$1,250.00
4Jan 15, 2026NorthMayaLaptop2$2,400.00
5Jan 22, 2026EastSamKeyboard12$720.00
6Feb 3, 2026WestZoeMonitor4$1,000.00
7Feb 11, 2026NorthAvaKeyboard8$480.00
8Feb 19, 2026SouthIvyLaptop4$4,800.00
9Feb 27, 2026EastSamMonitor6$1,500.00
10Mar 6, 2026WestNoahLaptop1$1,200.00
11Mar 14, 2026NorthMayaMonitor7$1,750.00
12
13

Click a cell to add it to your formula, drag to select a range, or click a column letter for the whole column.

Writing conditions

The condition is the part people get stuck on. Here are the patterns that cover nearly everything:

You wantWriteNotes
Equal to some text"Laptop"Not case-sensitive
Equal to a number5No quotes needed
Greater than a number">2000"The operator goes inside the quotes
Not equal to"<>East"
Equal to a cellH2No quotes around a cell reference
Compared with a cell">"&H2Join the operator to the cell with &
Contains some text"*board*"* means any characters
Blank cells""

For example, revenue from everything that isn't East, and revenue from any product with "board" in its name:

=SUMIF(B2:B11, "<>East", F2:F11)→ $16,480
=SUMIF(D2:D11, "*board*", F2:F11)→ $1,200

SUMIFS: add up with several conditions

SUMIFS adds a row only when every condition is true. How much laptop revenue came from the North?

=SUMIFS(F2:F11, B2:B11, "North", D2:D11, "Laptop")→ $6,000

Notice the order. In SUMIFS, the range you're adding up comes first, followed by pairs of range and condition. You can add up to 127 pairs.

SUMIFSUMIFS
ConditionsOneOne or more
Where the sum range goesLastFirst
Can you skip the sum range?YesNo

Because SUMIFS also works with a single condition, many people just use SUMIFS all the time so they never have to remember two argument orders:

=SUMIFS(E2:E11, C2:C11, "Sam")→ 18

That's the total units Sam sold.

Adding up between two dates

To total a date range, use two conditions on the same date column, one for the start and one for the end. Revenue for February 2026:

=SUMIFS(F2:F11, A2:A11, ">="&DATE(2026,2,1), A2:A11, "<"&DATE(2026,3,1))→ $7,780

DATE builds a real date, and & joins it to the operator. Using "before March 1" instead of "on or before February 28" means you never have to think about how many days a month has.

Either-or conditions

SUMIFS only does AND logic: every condition must match. For OR, like East or West, add two SUMIFs together:

=SUMIF(B2:B11, "East", F2:F11) + SUMIF(B2:B11, "West", F2:F11)→ $4,420

Common mistakes

ProblemWhat's going onFix
Result is 0The text doesn't match exactly, often because of extra spacesCheck the data, or use "*North*" to test
#VALUE! in SUMIFSThe ranges are different sizesMake every range cover the same rows
">"H2 doesn't workThe operator and cell weren't joinedWrite ">"&H2
Numbers aren't addedThey're stored as textConvert them with VALUE or Text to Columns
Wrong argument orderSUMIF puts the sum range last, SUMIFS puts it firstUse SUMIFS everywhere

The same pattern works for counting and averaging. COUNTIF and COUNTIFS count the matching rows, and AVERAGEIF and AVERAGEIFS average them. MAXIFS and MINIFS find the largest and smallest matching values. Once you know SUMIFS, you know all of them.

Key takeaways

  • SUMIF adds up the rows that match one condition. SUMIFS handles one or more.
  • In SUMIFS the sum range comes first. In SUMIF it comes last.
  • Put operators inside quotes, and join them to cells or dates with &.
  • For a date range, use two conditions on the same column: on or after the start, and before the day after the end.

Practice

Keep going with SUMIF and SUMIFS exercises

Reading gets you started. Solving a few of these is what makes it stick.

  1. 1Revenue for one regionFreeWhat was the total revenue from the North region?→
  2. 2Two conditions at once PremiumWhat was the revenue from Monitors sold in the South region?→
  3. 3Average for one rep PremiumOn average, how many units did Sam sell per order?→
  4. 4Count one productFreeHow many orders were for Laptops?→
All conditional math exercises →
Brian Millot

About the author

Brian Millot

Brian Millot is an indie hacker based in France who builds small, focused web products. He built and runs Excel Formula Practice, from the in-browser spreadsheet that checks your formulas to the exercise library, and he writes the formula guides.

Related guides

Practice makes formulas

Stop reading. Start typing formulas.

Every exercise is a real spreadsheet with instant feedback. The first two in every topic are free, no sign-up needed.