FormulaCamp
Completed
← All functions
Math

SUMIF

Sum with one condition.

Syntax

SUMIF(range, criteria, [sum_range])

Example: =SUMIF(A2:A20,"Boston",C2:C20)

Available in: All versions

SUMIF adds up the cells in a range that meet one condition: =SUMIF(range, criteria, [sum_range]). Use it to total sales for one region, expenses for one category or any amounts that match a single test.

When to use it

Arguments explained

Worked examples

Total for one region

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =SUMIF(A2:A7,"East",C2:C7)

Result: 2240

Adds the Amount (C) of every row where Region (A) is East: 1200 + 430 + 610.

Amounts over a threshold

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =SUMIF(C2:C7,">900")

Result: 3670

With one range, the same cells are tested and summed: 1200 + 970 + 1500.

Wildcard on names

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =SUMIF(B2:B7,"A*",C2:C7)

Result: 1810

"A*" matches names starting with A, here Ana twice: 1200 + 610.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =SUMIF(A2:A7,"East",C2:C7)

Example spreadsheet for SUMIF
ABCDEF
1RegionProductUnitsPriceResult
2EastPen1202.5180
3WestPen802.5
4EastBook4512
5NorthBook6012
6WestLamp3025
7EastLamp1525
Result in F2: 180
Practice this in a lesson: COUNTIF and SUMIF

Common errors and how to fix them

Related functions

Frequently asked questions

What is the difference between SUMIF and SUMIFS?
SUMIF has one condition and puts the sum range last. SUMIFS accepts many conditions and puts the sum range first.
Can SUMIF use OR logic?
Add two SUMIFs, or wrap criteria in an array constant: SUM(SUMIF(A:A,{"East","West"},C:C)).
Is SUMIF case sensitive?
No.
How do I sum by date with SUMIF?
Use a comparison with a cell reference, for example ">="&E1, where E1 holds the start date.

Practice

More in Math