Google Sheets SUMIF Criteria: How to Use It

How-to basics · Updated November 23, 2026

The SUMIF function in Google Sheets adds up numbers in a range only when they match a condition you specify. The basic syntax is =SUMIF(range, criterion, [sum_range]), where the criterion can be a number, text, expression, or cell reference. 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 Is SUMIF and When Should You Use It?

SUMIF is one of the most frequently used functions in Google Sheets because it lets you total data based on a single condition without manually filtering or sorting. It is ideal for tasks like summing sales by product, adding expenses by category, or totaling hours worked by a specific employee. Unlike the SUM function, which adds everything, SUMIF gives you control over which values are included.

For instance, if you have a list of orders with columns for product (A) and amount (B), you can find total sales for “Widget” with =SUMIF(A2:A100, "Widget", B2:B100). The function checks each cell in the range against the criterion and adds the corresponding value from the sum range only when there is a match.

How the SUMIF Syntax Works

The SUMIF function takes three arguments, with the third being optional:

  • range – the cells to evaluate against the criterion. This is required.
  • criterion – the condition that determines which cells to add. It can be a number, text, expression (like “>10”), or a cell reference containing the condition. This is required.
  • sum_range – the actual cells to sum. If omitted, the function sums the cells in the range itself. This is optional.

When you include a sum_range, it does not have to be the same size as the range, but Google Sheets uses the top-left cell of sum_range as the starting point and sums the corresponding cells relative to the range’s shape. For example, if range is A1:A10 and sum_range is B1:B10, it sums B1:B10. If sum_range is B1:C10, it sums B1:B10 (the first column only) because the range is one column wide.

Writing Criteria: Numbers, Text, and Wildcards

The criterion is the heart of SUMIF. Here are the most common ways to write it:

  • Numbers and expressions: Use comparison operators inside double quotes. For example, =SUMIF(A2:A10, ">=50", B2:B10) sums all B values where A is 50 or more. To match an exact number, you can write it without quotes: =SUMIF(A2:A10, 50, B2:B10).
  • Text: Put text in double quotes, like "Apples". SUMIF is case-insensitive, so “apples” and “APPLES” match. If your text contains a comparison operator, you need to use the ampersand (&) to concatenate, like "="&"Apples".
  • Wildcards: Use an asterisk (*) for any sequence of characters and a question mark (?) for a single character. For example, =SUMIF(A2:A10, "A*", B2:B10) sums all values where the text in A starts with “A”. To match a literal asterisk or question mark, prefix it with a tilde (~), like "~*".
  • Cell references: Instead of hardcoding the criterion, you can reference a cell. For example, if D1 contains “Widget”, use =SUMIF(A2:A100, D1, B2:B100). For expressions, combine with the ampersand: =">"&D1.

One common mistake is writing ">=50" without quotes – that will cause an error. Another is using a comma as a decimal separator if your spreadsheet locale uses a period; the function uses the locale’s separator.

Practical Examples of SUMIF in Action

Let’s walk through a few realistic scenarios. Assume you have a spreadsheet with sales data:

  • Column A: Product names (A2:A20)
  • Column B: Sales amounts (B2:B20)
  • Column C: Region (C2:C20)

Example 1 – Sum sales for a specific product:
=SUMIF(A2:A20, "Laptop", B2:B20) returns the total sales for all rows where the product is “Laptop”. If the total is 15,000, that means the sum of all B values in rows with “Laptop” equals 15,000.

Example 2 – Sum sales above a threshold:
=SUMIF(B2:B20, ">1000", B2:B20) adds up all sales amounts greater than 1,000. Since the sum_range is the same as the range, it sums the qualifying B cells themselves.

Example 3 – Sum sales for the West region using a cell reference:
If D1 contains “West”, =SUMIF(C2:C20, D1, B2:B20) sums all sales in the West region.

Example 4 – Using wildcards to sum products starting with “Pro”:
=SUMIF(A2:A20, "Pro*", B2:B20) adds sales for product names like “ProBook” or “ProMax”.

Common Mistakes and How to Fix Them

Even experienced users run into issues with SUMIF. Here are the most frequent problems and solutions:

  • #VALUE! error: This usually happens when the criterion is not a valid expression. Check that text is in quotes and that comparison operators are inside quotes. Also ensure the range and sum_range are the same size or that sum_range is correctly aligned.
  • Summing wrong values: If your sum_range is not aligned with the range, you’ll get incorrect totals. For example, if range is A2:A20 and sum_range is B2:B19, the last row is ignored. Always make sure both ranges start at the same row.
  • Case sensitivity: SUMIF is not case-sensitive, so “apple” and “APPLE” are treated the same. If you need case-sensitive matching, use SUMIFS with an array formula or the FILTER function, but that is more advanced.
  • Using SUMIF with dates: Dates are stored as numbers in Google Sheets. To sum by a date, use the DATE function or a cell reference. For example, =SUMIF(A2:A20, ">="&DATE(2025,1,1), B2:B20) sums all sales from January 1, 2025 onward.
  • Blank cells: If your criterion is an empty string (“”), SUMIF will sum cells that are blank. To sum non-blank cells, use "<>" as the criterion.

SUMIF vs. SUMIFS: When to Use Each

Google Sheets also has a SUMIFS function that allows multiple criteria. The syntax is =SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, criterion2, ...]). The key difference is that SUMIFS always requires a separate sum_range, and the criteria ranges must be the same size.

Use SUMIF when you have only one condition. Use SUMIFS when you need two or more conditions. For example, to sum sales for “Laptop” in the “West” region, you would write =SUMIFS(B2:B20, A2:A20, "Laptop", C2:C20, "West").

There is also a subtle difference in how the two functions handle criteria: SUMIFS does not accept wildcards in the same way for some versions, but in current Google Sheets, wildcards work in both. However, SUMIFS is generally more flexible for complex conditions, and it is the recommended function for multi-condition sums.

Alternatives to SUMIF: QUERY, FILTER, and Pivot Tables

While SUMIF is powerful, other tools can achieve the same result, sometimes more efficiently:

  • FILTER + SUM: You can combine SUM(FILTER(B2:B20, A2:A20="Laptop")) to sum filtered values. This is more flexible for complex conditions and works with arrays.
  • QUERY: The QUERY function uses a SQL-like syntax. For example, =QUERY(A2:B20, "select sum(B) where A='Laptop' label sum(B) ''") returns the total. It is powerful but has a steeper learning curve.
  • Pivot tables: For quick summaries without formulas, a pivot table can group data by product and show sums. This is ideal for interactive reports.

Each method has its place. SUMIF is the simplest for a single condition, FILTER is great for dynamic arrays, and QUERY shines for complex data manipulation.

Frequently Asked Questions

Can I use SUMIF with a cell reference for the criterion?

Yes, you can use a cell reference directly. For example, if D1 contains “Apples”, =SUMIF(A2:A10, D1, B2:B10) will sum all values where column A equals the text in D1. This makes your formulas dynamic – changing D1 updates the result without editing the formula.

How do I sum if a cell contains specific text?

Use wildcards. To sum all rows where column A contains the word “apple” anywhere, use "*apple*". For example, =SUMIF(A2:A10, "*apple*", B2:B10). Remember that this is case-insensitive, so it will match “Apple”, “apple”, and “Pineapple”.

Why is my SUMIF returning 0 even though there are matches?

This often happens when the criterion is a number stored as text, or when the range contains numbers formatted as text. Check that your data is truly numeric. Also, if you are using a comparison like “>100”, ensure the numbers in the range are not text strings. Use the VALUE function to convert text to numbers, or clean the data.

Can I use SUMIF with dates?

Yes, but you need to be careful with date formatting. Use the DATE function or a cell reference. For example, to sum sales after a certain date, put the date in a cell (say D1) and use =SUMIF(A2:A10, ">"&D1, B2:B10). This works because dates are stored as serial numbers.

Does SUMIF work with multiple columns in the sum range?

Yes, but it sums the entire sum_range that corresponds to the range. If your range is A2:A10 and sum_range is B2:C10, it will sum both columns B and C for rows that match the criterion. If you only want one column, specify that column as the sum_range.

Is there a limit to the number of criteria in SUMIF?

SUMIF only supports one criterion. For multiple criteria, use SUMIFS. SUMIFS can handle up to 127 range/criteria pairs, which is more than enough for practical use.

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.