Skip to content

SUMIFS

Adds up the numbers that meet every condition you set. One condition or a dozen, it's the same function.

Quick answer

=SUMIFS(what to add, where to check, what to match, …)

Put the column to add first, then pairs of a range and a condition. A row only counts if every condition is true.

Excel 2007 and later
Sales.xlsx3 steps

Step 1 · Watch

Total East's revenue in C11.

C11=SUMIFS(C2:C9,A2:A9,A11)

SUMIFS added every row where the region is East: four sales. Your turn next.

Steps 2 and 3 · Your turn

Task 1 of 2

In C12, total East's laptop revenue. That's two conditions.

Answer in C12.

C12
A
B
C
1
Region
Product
Revenue
2
East
Laptops
$6,200
3
West
Monitors
$2,400
4
East
Monitors
$3,100
5
North
Laptops
$5,800
6
East
Laptops
$4,500
7
West
Laptops
$7,300
8
North
Monitors
$1,900
9
East
Phones
$2,750
10
Region
Product
Revenue
11
East
$16,550
12
East
Laptops
13
Over
$5,000
01

The range to add comes first.

Then the conditions, two arguments at a time. Hover, focus or press an argument to see what it points at.

=SUMIFS(,,,,,)

C12=SUMIFS(C2:C9,A2:A9,A12,B2:B9,B12)

A
B
C
1
Region
Product
Revenue
2
East
Laptops
$6,200
3
West
Monitors
$2,400
4
East
Monitors
$3,100
5
North
Laptops
$5,800
6
East
Laptops
$4,500
7
West
Laptops
$7,300
8
North
Monitors
$1,900
9
East
Phones
$2,750
10
11
12
East
Laptops
$10,700

Each argument has its own colour, the way Excel colours references while you edit. Rows that pass every condition are added up in C12.

02

Three ways you'll use it.

Change the inputs and watch the formula and the sheet respond.

Example 1

Any mix of conditions

Pick a region, a product, or both. “Any” puts * in the condition cell, which matches any text.

Region
Product

4 rows pass both conditions, every East sale: $16,550. The * lets any text through.

C11=SUMIFS(C2:C9,A2:A9,A11,B2:B9,B11)

A
B
C
1
Region
Product
Revenue
2
East
Laptops
$6,200
3
West
Monitors
$2,400
4
East
Monitors
$3,100
5
North
Laptops
$5,800
6
East
Laptops
$4,500
7
West
Laptops
$7,300
8
North
Monitors
$1,900
9
East
Phones
$2,750
10
Region
Product
Revenue
11
East
*
$16,550

Example 2

Between two numbers

Use the same column twice: once for the lower limit, once for the upper. Join each operator to its cell with &.

$3,000
$6,000

3 sales are between $3,000 and $6,000, adding up to $13,400. One column, two conditions.

C11=SUMIFS(C2:C9,C2:C9,">="&A11,C2:C9,"<="&B11)

A
B
C
1
Region
Product
Revenue
2
East
Laptops
$6,200
3
West
Monitors
$2,400
4
East
Monitors
$3,100
5
North
Laptops
$5,800
6
East
Laptops
$4,500
7
West
Laptops
$7,300
8
North
Monitors
$1,900
9
East
Phones
$2,750
10
From
To
Revenue
11
$3,000
$6,000
$13,400

Example 3

Wildcards and “not”

* stands for any run of characters, ? for exactly one, and <> means “not”.

Pattern

* stands for any characters, so this matches everything that starts with “Laptop”. 2 rows, $11,800.

B9=SUMIFS(B2:B7,A2:A7,A9)

A
B
1
Product
Revenue
2
Laptop Pro
$7,300
3
Laptop Air
$4,500
4
Monitor 27
$2,400
5
Monitor 32
$3,100
6
Phone X
$2,750
7
Phone Pro
$3,900
8
Pattern
Revenue
9
Laptop*
$11,800
03

Why SUMIFS, not SUMIF.

They look alike, but the arguments come in a different order. Add a second condition and see which one copes.

A
B
C
1
Region
Product
Revenue
2
East
Laptops
$6,200
3
West
Monitors
$2,400
4
East
Monitors
$3,100
5
North
Laptops
$5,800
6
East
Laptops
$4,500
7
West
Laptops
$7,300
8
North
Monitors
$1,900
9
East
Phones
$2,750

SUMIF

E1=SUMIF(A2:A9,"East",C2:C9)

$16,550 · all of East

SUMIFS

E1=SUMIFS(C2:C9,A2:A9,"East")

$16,550 · all of East

SUMIF(range, criteria, [sum_range]) · SUMIFS(sum_range, criteria_range1, criteria1, …)

Your manager asks for East’s laptops only.

SUMIF compared with SUMIFS
SUMIFSUMIFS
ConditionsOneUp to 127
Where the range to add goesLast, and optionalFirst, and required
How conditions combineOnly one conditionAll must be true
“This or that”Add two SUMIFsAdd two SUMIFS, or wrap an array of values in SUM
Wildcards and comparisonsYesYes
Works in Excel 2007 and laterYesYes
04

When it goes wrong.

SUMIFS rarely shows an error. More often it quietly returns the wrong total, usually 0. Fix each formula yourself, or press “Show me”.

#VALUE!

Ranges of different sizes

The range to add runs to row 6 but the region range stops at row 5. Every range in SUMIFS must be the same size.

A
B
1
Region
Revenue
2
East
$6,200
3
West
$2,400
4
East
$3,100
5
North
$5,800
6
East
$4,500
7
8
East
#VALUE!

Shows #VALUE!.

$0

The condition is in the wrong column

“Laptops” is a product, but this checks it against the Region column, so nothing matches. Point the condition at the Product column.

A
B
C
1
Region
Product
Revenue
2
East
Laptops
$6,200
3
West
Monitors
$2,400
4
East
Monitors
$3,100
5
North
Laptops
$5,800
6
East
Phones
$2,750
7
8
Laptops
$0

Shows $0.

$0

A cell reference inside the quotes

Inside quotes, A8 is just the letters “A8”, so no amount matches. Keep the operator in quotes and join the cell with &.

A
B
1
Rep
Amount
2
Ana
$4,200
3
Ben
$7,300
4
Cara
$1,900
5
Dev
$5,600
6
Eli
$3,100
7
8
5000
$0

Shows $0.

05

Questions people ask.

How do I use SUMIFS with multiple criteria?

Add a pair of arguments for each condition: range, then criteria. A row is added only when all conditions are met, for example `=SUMIFS(D2:D9, B2:B9, "North", C2:C9, "Widgets")`.

How do I sum between two dates?

Use two conditions on the date column: `=SUMIFS(D2:D9, A2:A9, ">="&F2, A2:A9, "<"&G2)`. F2 is the first day and G2 is the day after the last.

Why does SUMIFS return 0?

Nothing met all of the conditions. Check for extra spaces or numbers stored as text, and look for a quoted cell reference such as `">=F2"`. Try each condition alone to find the one that fails.

Can SUMIFS use OR?

Not directly, since conditions are joined with AND. Wrap an array of values in SUM: `=SUM(SUMIFS(D2:D9, B2:B9, {"North","East"}))`, or add two SUMIFS.

What is the difference between SUMIFS and SUMPRODUCT?

SUMIFS is easier to read and faster on big tables. SUMPRODUCT is needed when a condition is calculated, such as testing the month of a date, because SUMIFS criteria must point at cell values.

Does SUMIFS work across sheets?

Yes, as long as every range has the same number of rows. Write the sheet name in each reference, for example `Data!D2:D9`.

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 3

In H2, total the revenue for the region in F2 and the channel in G2.

Answer in H2.

H2
A
B
C
D
E
F
G
H
1
Region
Channel
Units
Revenue
Region
Channel
Revenue
2
North
Online
40
1,600
North
Online
3
North
Retail
25
1,250
4
South
Online
30
1,200
Region
Min units
Revenue
5
South
Retail
55
2,750
South
40
6
East
Online
20
800
7
East
Retail
35
1,750
Region
Channel
Revenue
8
North
Online
15
600
South
Retail
9
South
Online
45
1,800
East
Retail
10
North
Retail
11
12

Common mistakes

  • If the ranges have different sizes, such as D2:D9 with B2:B8, SUMIFS returns #VALUE!. Make every range start and end on the same rows.
  • Writing the operator and cell inside one set of quotes, as in ">="&F2 written ">=F2", compares against the text "F2" and returns 0. Close the quote and join the cell with &.
  • The cells to add come first in SUMIFS but last in SUMIF. Moving a formula from one to the other without reordering gives a wrong total or #VALUE!.
  • Conditions are joined with AND. Two conditions on the same column for different values, such as North and East, return 0. Add the results, or use an array of criteria inside SUM.
  • Numbers stored as text don't match numeric criteria, and a text code such as "1043" doesn't match the number 1043. Check the data type of both columns.
  • Filling a SUMIFS down without dollar signs makes the ranges slide. Lock them as $D$2:$D$9.

Learn SUMIFS in a real sheet.

SUMIFS is taught in Data analysis with formulas, lesson 1: SUMIFS: totals by group. Each lesson is a short, graded exercise like the one above.