Math

Google Sheets SUMIF Function — Syntax, Examples & Tips

Learn how to use SUMIF in Google Sheets to sum values based on a condition. Includes wildcard matching, date criteria, and comparison operators.

Syntax
=SUMIF(range, criterion, [sum_range])

What SUMIF Does

SUMIF adds up values in a range that meet a specific condition. For example, you can sum all sales from a particular region or total expenses above a certain amount. It saves you from manually filtering data before summing.

Syntax

=SUMIF(range, criterion, [sum_range])
ParameterDescription
rangeThe range of cells to evaluate against the criterion.
criterionThe condition that determines which cells to sum. Can be a number, text, expression, or cell reference.
sum_rangeThe range of cells to actually sum. If omitted, the cells in range are summed.

Basic Examples

Example 1: Sum Sales by Region

AB
1RegionSales
2East4500
3West3200
4East6100
5West2800
=SUMIF(A2:A5, "East", B2:B5)

Result: 10600 (4500 + 6100)

Example 2: Sum Values Greater Than a Threshold

=SUMIF(B2:B5, ">3000", B2:B5)

Result: 13800 (4500 + 6100 + 3200)

Note: When using comparison operators, wrap the criterion in quotes.

Example 3: Sum by Cell Reference

If cell D1 contains the region you want to total:

=SUMIF(A2:A5, D1, B2:B5)

This makes your formula dynamic — change D1 and the total updates automatically.

Advanced Examples

Wildcard Matching

Sum revenue for all products that start with "Pro":

=SUMIF(A2:A100, "Pro*", B2:B100)

This matches "Pro Plan", "Professional", "ProMax", etc. Use ? for a single-character wildcard and * for any number of characters.

Summing by Date Range

Sum all expenses on or after January 1, 2026:

=SUMIF(A2:A100, ">="&DATE(2026,1,1), B2:B100)

The ampersand (&) joins the operator ">=" with the DATE function to build the criterion dynamically.

Common Mistakes

  • Forgetting quotes around operators. Criteria like >100 must be written as ">100". Without quotes, Google Sheets throws a parsing error.
  • Mismatched range sizes. The range and sum_range should have the same number of rows (or columns). If they differ, SUMIF only uses the dimensions of range to decide which cells in sum_range to add.
  • Using SUMIF for multiple conditions. SUMIF handles only one criterion. For two or more conditions (e.g., region = "East" AND month = "Jan"), use SUMIFS instead.

SheetAI Tip

Don't want to memorize this syntax? With SheetAI, just type what you need in plain English — like "sum all sales where region is East" — and the formula is generated for you. Install SheetAI to try it free.

Skip the formula. Describe what you need.

SheetAI lets you type what you want in plain English and generates the perfect formula — no syntax to memorize.

Try SheetAI Free