SUMIF Function: How to Use It with Examples

Formulas & functions · Updated November 23, 2026

The SUMIF function in Excel adds up numbers in a range that meet a single condition, using the syntax SUMIF(range, criteria, [sum_range]). For example, =SUMIF(A2:A10, "West", B2:B10) sums all values in B2:B10 where the matching cell in A2:A10 equals “West”.

What SUMIF Does and Why It Matters

SUMIF is one of Excel’s oldest conditional functions, introduced in Excel 2007 and available in every version since, including Excel for Microsoft 365, Excel 2021, Excel 2019, and Excel for the web. It lets you total only the values that match a rule you specify, saving you from manually filtering or writing long IF formulas. The function is essential for summarizing sales by region, expenses by category, or hours worked by employee—any task where you need a conditional total.

Unlike SUMIFS, which handles multiple conditions, SUMIF works with a single condition. That simplicity makes it easier to learn and read, but it also means you need SUMIFS for anything more complex. Understanding SUMIF first gives you a solid foundation for the more advanced function.

How the SUMIF Function Works: Syntax and Arguments

The syntax is SUMIF(range, criteria, [sum_range]). The first two arguments are required; the third is optional.

  • range – The cells you want to evaluate against the criteria. This can be a single column, row, or a rectangular block.
  • criteria – The condition that determines which cells to add. It can be a number, text, expression, or cell reference. For example, ">100", "Apples", or B1.
  • sum_range – The actual cells to sum. If omitted, Excel sums the cells in range.

If you include sum_range, it should be the same size and shape as range. Excel doesn’t require them to be aligned, but it will sum the top-left cell of sum_range corresponding to the position of each match in range. For example, if range is A1:A5 and sum_range is B1:B5, Excel sums B1 when A1 matches, B2 when A2 matches, and so on.

SUMIF Examples: Text, Numbers, and Wildcards

Let’s work through concrete examples. Assume you have a sales table with products in column A (A2:A10) and amounts in column B (B2:B10).

Example 1: Exact text match
To sum all amounts for “Apples”:
=SUMIF(A2:A10, "Apples", B2:B10)
If A2:A10 contains “Apples” in A2, A5, and A7, and B2=10, B5=20, B7=30, the result is 60.

Example 2: Numeric criteria
To sum all amounts greater than 100:
=SUMIF(B2:B10, ">100")
Here, since you omit sum_range, Excel sums the values in B2:B10 that are greater than 100. If B2=150, B3=80, B4=200, the result is 350.

Example 3: Wildcards for partial text
To sum amounts for any product that starts with “App”:
=SUMIF(A2:A10, "App*", B2:B10)
The asterisk (*) matches any sequence of characters. A question mark (?) matches any single character. So “App*” matches “Apples”, “Apricots”, and “Appetizers”.

Example 4: Cell reference in criteria
If D1 contains the product name, use:
=SUMIF(A2:A10, D1, B2:B10)
This is cleaner than typing the text directly, and it updates automatically if D1 changes.

SUMIF vs. SUMIFS: Which One Should You Use?

SUMIFS is the newer function (also available since Excel 2007) that sums cells meeting multiple criteria. Its syntax is SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...). The key differences:

  • Argument order – SUMIF puts the criteria range first; SUMIFS puts the sum range first.
  • Number of conditions – SUMIF handles one; SUMIFS handles up to 127 pairs of criteria ranges and criteria.
  • Wildcards – Both support wildcards, but SUMIFS also supports the tilde (~) to escape wildcards.

When you have only one condition, either works. Many users prefer SUMIFS because it’s more consistent with other IFS functions and easier to extend later. For example, to sum sales for “West” region in Q1, you’d write:
=SUMIFS(C2:C10, A2:A10, "West", B2:B10, "Q1")
With SUMIF, you’d need a helper column or a different approach. So if you think you might add more conditions, start with SUMIFS.

Common Problems and How to Fix Them

Several mistakes trip up new users:

  • Wrong argument order – Mixing up SUMIF and SUMIFS order is the most common error. Double-check which function you’re using.
  • Criteria with text and comparison operators – If you write =SUMIF(A2:A10, >100, B2:B10) without quotes, Excel shows a formula error. You need quotes: ">100".
  • Text criteria are case-insensitive – SUMIF does not distinguish between “apples” and “Apples”. If you need case-sensitive matching, you must use SUMPRODUCT with EXACT.
  • Criteria with dates – To sum amounts after a certain date, use a date serial number or the DATE function: =SUMIF(A2:A10, ">"&DATE(2024,1,1), B2:B10). Using text like “>1/1/2024” may be misinterpreted depending on regional settings.
  • Blank or empty cells – SUMIF ignores empty cells in the criteria range when the criteria is not blank. To sum cells where the criteria range is blank, use "=" as criteria. To sum where not blank, use "<>".

Using SUMIF with Dates and Blank Cells

Dates are stored as serial numbers in Excel, so you can use comparison operators. For example, to sum all amounts after January 1, 2024, with dates in A2:A10 and amounts in B2:B10:
=SUMIF(A2:A10, ">"&DATE(2024,1,1), B2:B10)
The DATE function ensures the date is interpreted correctly regardless of your system’s date format.

To sum amounts where the region (A2:A10) is blank:
=SUMIF(A2:A10, "=", B2:B10)
To sum where the region is not blank:
=SUMIF(A2:A10, "<>", B2:B10)

Note that SUMIF treats cells containing empty text (from a formula like ="") as blank for these criteria, which can cause unexpected results. In such cases, consider using SUMPRODUCT with LEN to be precise.

Alternatives to SUMIF: SUMPRODUCT and Dynamic Arrays

For more flexibility, SUMPRODUCT can sum with multiple conditions and even perform calculations on the criteria range. For example, to sum amounts where the amount is greater than the average:
=SUMPRODUCT((B2:B10)*(B2:B10>AVERAGE(B2:B10)))
This multiplies each amount by 1 if the condition is true, and 0 otherwise, then sums the products.

In Excel 365, you can also use the FILTER function to create a dynamic array of matching values and then sum them:
=SUM(FILTER(B2:B10, A2:A10="West"))
This returns the sum of all B values where A equals “West”. FILTER is more versatile because you can feed the filtered array into other functions, but it requires Microsoft 365 or Excel 2021.

For case-sensitive sums, use SUMPRODUCT with EXACT:
=SUMPRODUCT((EXACT(A2:A10, "Apples")*B2:B10))
This sums only the cells where A2:A10 exactly matches “Apples” in case.

Frequently Asked Questions

Can SUMIF sum based on cell color?
No. SUMIF works on cell values, not formatting. To sum by color, you need to use VBA or the SUBTOTAL function with a filtered table. There is no built-in function that sums colored cells without a macro.

Why does my SUMIF return 0 even though I see matching values?
This usually happens when the criteria text doesn’t match exactly—extra spaces, non-printing characters, or a different case (though case is ignored). Check for leading/trailing spaces using the TRIM function, and ensure the criteria is in quotes or references a cell with the exact text.

Can I use SUMIF across multiple sheets?
Yes, you can reference other sheets by including the sheet name in the range, like =SUMIF(Sheet2!A2:A10, "West", Sheet2!B2:B10). For multiple sheets, you’d need to add several SUMIFs or use a 3D reference, which SUMIF does not support directly.

Is there a limit to how many criteria SUMIF can handle?
SUMIF itself only handles one criteria. If you need more, use SUMIFS, which supports up to 127 criteria pairs. There is no limit on the number of cells in the range, only Excel’s overall row limit (about 1,048,576 rows).

Does SUMIF work with text that contains wildcards?
Yes, but if you want to match a literal asterisk or question mark, you must escape it with a tilde (~). For example, to sum amounts for products that contain an asterisk, use "~*" as the criteria.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

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

Spotted an error in this guide? Let us know.