FormulaCamp
Completed
← Google Sheets functions
Google Sheets function

SUMIF in Google Sheets

Google Sheets also has QUERY, which can total by group in one formula, for example a select with sum and group by clauses.

Syntax (same in Google Sheets)

SUMIF(range, criteria, [sum_range])

SUMIF is simpler when you need one total for one condition.

For a fuller explanation of the arguments and common errors, see the SUMIF Excel guide.

Worked examples in Google Sheets

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

Frequently asked questions

When should I use QUERY instead of SUMIF in Google Sheets?
Use QUERY when you want a whole summary table, one total per category, from a single formula. Use SUMIF for a single conditional total that sits in one cell.

Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.