Google Sheets SUMIF: How It Works & Examples

How-to basics · Updated November 23, 2026

The SUMIF function in Google Sheets adds up numbers in a range only when they meet a condition you specify. The basic syntax is =SUMIF(range, criterion, [sum_range]), where range is the cells to check, criterion is the condition (like “>100” or “Apples”), and sum_range is the cells to add (if different from the check range). For example, =SUMIF(A2:A10, ">100", B2:B10) sums all values in B2:B10 where the corresponding cell in A2:A10 is greater than 100.

What SUMIF Does and When to Use It

SUMIF is one of the most-used functions in Google Sheets because it lets you total data based on a single condition without manually filtering or sorting. You might use it to sum sales for a specific product, total hours worked by one employee, or add up expenses in a certain category. It works with numbers, text, dates, and even wildcards. If you need to sum based on multiple conditions, you would use SUMIFS instead, which accepts multiple range/criterion pairs.

How to Use SUMIF: Step-by-Step

To use SUMIF in Google Sheets, follow these steps:

  • Click the cell where you want the result.
  • Type =SUMIF( (or use Insert > Function > SUMIF).
  • Select the range to evaluate (e.g., A2:A10).
  • Type a comma, then the criterion in quotes (e.g., “>100” or “Apples”).
  • Type a comma, then select the sum range (e.g., B2:B10), or omit it to sum the same range.
  • Press Enter.

For example, with data in A2:A10 (categories) and B2:B10 (amounts), =SUMIF(A2:A10, "Food", B2:B10) returns the total of all amounts in rows where the category is “Food”. If you omit the third argument, =SUMIF(B2:B10, ">500") sums all values in B2:B10 that are greater than 500.

Understanding the Criterion: Text, Numbers, and Wildcards

The criterion is the heart of SUMIF. It can be a number, text, expression, or cell reference. Here are the key rules:

  • Text: Put text in double quotes, e.g., "Apples". It is case-insensitive, so “apples” matches “Apples”.
  • Numbers: Use numbers without quotes, e.g., 100 or "100" both work.
  • Expressions: Use comparison operators inside quotes, e.g., ">100", "<50", "<>0" (not equal to zero).
  • Cell references: Concatenate with the operator, e.g., ">"&D1 to compare against the value in D1.
  • Wildcards: Use * for any sequence of characters and ? for any single character. For example, "A*" matches any text starting with "A". To match a literal asterisk, use "~*".

For dates, you must use the DATE function or a date serial number, e.g., ">"&DATE(2025,1,1) to sum values after January 1, 2025.

Common Mistakes and How to Fix Them

Several pitfalls trip up new users:

  • Using quotes around numbers in expressions: SUMIF(A2:A10, ">100") is correct, but SUMIF(A2:A10, >100) without quotes causes an error.
  • Mismatched ranges: The sum_range and range must be the same size, or SUMIF will use the top-left cell and extend automatically, which can give unexpected results. Keep them aligned.
  • Text vs. numbers: If your data has numbers stored as text, SUMIF may not match. Use VALUE or clean the data first.
  • Wildcards in text: If you want to sum text that literally contains an asterisk, you need to escape it with a tilde (~*).

Another common issue is using SUMIF when you actually need SUMIFS. SUMIF only handles one condition; SUMIFS handles multiple and has a different argument order: =SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, criterion2, ...]).

SUMIF vs. SUMIFS: Which One to Choose

Choose SUMIF when you have exactly one condition. Choose SUMIFS when you have two or more conditions. For example, to sum sales for Product A in the West region, you would use =SUMIFS(C2:C100, A2:A100, "Product A", B2:B100, "West") where C is the sales amount, A is product, and B is region. SUMIFS is also more flexible because it allows you to sum a range that is different from the criteria ranges, which is not always possible with SUMIF (though SUMIF does have a sum_range argument).

Real-World Examples of SUMIF in Action

Here are three practical examples with sample data:

  • Example 1 – Sales by product: With products in A2:A20 and sales in B2:B20, =SUMIF(A2:A20, "Widget", B2:B20) returns the total sales for Widget. If Widget appears 5 times with values 10, 20, 30, 40, 50, the result is 150.
  • Example 2 – Summing above a threshold: With amounts in A2:A10, =SUMIF(A2:A10, ">1000") sums only those values greater than 1000. If A2:A10 contains 500, 1500, 2000, 800, the result is 3500.
  • Example 3 – Using a cell reference: With a threshold in D1, =SUMIF(A2:A10, ">"&D1) sums values greater than the number in D1. If D1 is 1000, the result is the same as above.

Frequently Asked Questions

Can SUMIF sum based on text that contains a specific word?

Yes, use wildcards. For example, =SUMIF(A2:A10, "*apple*", B2:B10) sums all amounts in B where the corresponding text in A contains "apple" anywhere. The asterisks match any characters before or after.

Why is my SUMIF returning 0?

This usually happens when the criterion doesn't match any cells. Check for extra spaces, text vs. number formatting, or incorrect operators. For example, if your data has numbers stored as text, ">100" won't match. Also, ensure the range and sum_range are correctly aligned.

How do I sum if a cell is not blank?

Use =SUMIF(A2:A10, "<>", B2:B10) to sum all B values where A is not blank. The criterion "<>" means "not equal to nothing". To sum if blank, use "=" (though this may not work as expected; a more reliable way is to use SUMPRODUCT with ISBLANK).

Can I use SUMIF with dates?

Yes, but you need to use a date serial number or the DATE function. For example, =SUMIF(A2:A10, ">"&DATE(2025,1,1), B2:B10) sums amounts where the date in A is after January 1, 2025. Alternatively, you can use a cell reference containing a date.

Does SUMIF work across multiple sheets?

Yes, you can reference other sheets in the range. For example, =SUMIF(Sheet2!A2:A10, "Apples", Sheet2!B2:B10) sums values on Sheet2. You can also use a 3D reference with SUMIFS, but SUMIF itself does not support 3D references across multiple sheets in a single function.

Is there a way to sum with multiple criteria without SUMIFS?

Yes, you can use SUMPRODUCT, which is more flexible. For example, =SUMPRODUCT((A2:A10="Product A")*(B2:B10="West")*C2:C10) sums C values where A is "Product A" and B is "West". This works because TRUE/FALSE are treated as 1/0 in multiplication.

Alternatives and Related Functions

Besides SUMIF and SUMIFS, Google Sheets offers other ways to sum conditionally:

  • COUNTIF and COUNTIFS: Count cells that meet a condition instead of summing.
  • AVERAGEIF and AVERAGEIFS: Average cells that meet a condition.
  • SUMPRODUCT: A more powerful function that can handle multiple conditions and array calculations.
  • QUERY: The QUERY function can sum with conditions using SQL-like syntax, e.g., =QUERY(A1:B10, "select sum(B) where A = 'Apples' label sum(B) ''").
  • FILTER: Combine FILTER with SUM, e.g., =SUM(FILTER(B2:B10, A2:A10="Apples")).

Each has its strengths; SUMIF is the simplest for a single condition, while SUMIFS and SUMPRODUCT handle more complex logic.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.