SUMIF Syntax in Excel: How to Use It Correctly

Formulas & functions · Updated November 23, 2026

The SUMIF function in Excel adds up values in a range that meet a single condition. Its syntax is SUMIF(range, criteria, [sum_range]), where range is the cells to check, criteria is the condition, and sum_range (optional) is the cells to add. If you omit sum_range, Excel sums the cells in range itself.

Breaking Down Each Argument

The three parts of SUMIF each have a specific job, and getting them mixed up is the most common mistake. Here is what each argument expects:

  • range (required): The range of cells you want to evaluate against the criteria. This can be a column like A2:A100, a row, or a named range. Text, numbers, and dates all work here.
  • criteria (required): The condition that determines which cells count. It can be a number (like 100), a text string (like "Paid"), a logical expression (like ">10"), or a cell reference that contains the condition (like D1). Text criteria must be in double quotes; numbers and cell references do not need quotes.
  • sum_range (optional): The actual cells to add if they match. If you leave this out, Excel sums the cells in range. When you include it, it must be the same size and shape as range—Excel does not require them to start on the same row, but it will pair them positionally.

How SUMIF Works: A Simple Example

Suppose you have sales data with product names in column A (A2:A10) and amounts in column B (B2:B10). To sum all sales of “Widget”, you would write:

=SUMIF(A2:A10,"Widget",B2:B10)

This checks each cell in A2:A10 for the text “Widget”. For every match, it adds the corresponding value from B2:B10. If your data has 3 Widgets with amounts 10, 20, and 30, the result is 60.

If you wanted to sum all amounts greater than 100 directly from column B, you would use:

=SUMIF(B2:B10,">100")

Here, the range and sum_range are the same, so only cells in B that meet the condition are added. Note the quotes around ">100"—logical operators must be inside a text string.

Using Cell References in Criteria

Hardcoding criteria like “Widget” works, but it makes the formula inflexible. Instead, put the condition in a cell and reference it. For example, if cell D1 contains the text “Widget”, write:

=SUMIF(A2:A10,D1,B2:B10)

When the criteria is a cell reference, you do not use quotes. For logical operators with a reference, you need to concatenate: =SUMIF(B2:B10,">"&D1). If D1 contains 100, this sums all values greater than 100. The ampersand (&) joins the operator with the number.

Common Mistakes and How to Fix Them

Several errors trip up new users. Here are the most frequent ones and their solutions:

  • Wrong sum_range size: If range is A2:A10 and sum_range is B2:B9, Excel will still work but may misalign values. Always keep them the same number of rows and columns.
  • Text criteria without quotes: Writing =SUMIF(A2:A10,Widget,B2:B10) returns a #NAME? error because Excel treats Widget as a named range. Always quote text.
  • Using wildcards incorrectly: SUMIF supports asterisks (*) for any sequence and question marks (?) for a single character. To find cells that start with “W”, use "W*". To match a literal asterisk, wrap it in tildes: "~*".
  • Case sensitivity: SUMIF is not case-sensitive. It treats “widget” and “WIDGET” as the same. If you need case-sensitive matching, you must use SUMPRODUCT with EXACT.
  • Blank cells in criteria: To sum cells that are blank, use "=" as the criteria. For non-blank cells, use "<>".

SUMIF vs. SUMIFS vs. SUMPRODUCT

SUMIF handles one condition. SUMIFS handles multiple conditions and has a different argument order: SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...). Notice that in SUMIFS, the sum range comes first, while in SUMIF it comes last. This is a common source of confusion when switching between them.

SUMPRODUCT is a more flexible alternative that can handle arrays and multiple conditions without the same syntax restrictions. For example, to sum values where column A is “Widget” and column B is greater than 50, you could use:

=SUMPRODUCT((A2:A10="Widget")*(B2:B10>50)*C2:C10)

This multiplies the condition results (TRUE/FALSE, which Excel treats as 1/0) by the values in C. It is powerful but can be slower on large datasets. For most single-condition needs, SUMIF is simpler and faster.

Using SUMIF with Dates and Text

Dates in criteria must be handled carefully. If you write =SUMIF(A2:A10,"1/1/2024",B2:B10), Excel may interpret the date as text depending on your regional settings. A safer approach is to use the DATE function: =SUMIF(A2:A10,">"&DATE(2024,1,1),B2:B10). This sums all dates after January 1, 2024. For exact date matches, reference a cell containing a real date: =SUMIF(A2:A10,D1,B2:B10) where D1 holds a date.

For text, wildcards are your friend. To sum all sales for products that contain “Pro” anywhere, use "*Pro*". To sum products that start with “Pro”, use "Pro*". Remember that SUMIF treats text as case-insensitive, so “pro” matches “Pro” too.

Performance and Large Data Sets

SUMIF is generally fast, but if you use it on hundreds of thousands of rows, it can slow down your workbook. For large datasets, consider using a PivotTable instead—it calculates sums by category without formulas. If you must use a formula, SUMIFS with multiple conditions is often faster than SUMIF with a helper column, because it avoids the extra calculation. Also, avoid using full-column references like A:A unless necessary; limiting to the actual data range (e.g., A2:A10000) reduces calculation time.

Frequently Asked Questions

Can I use SUMIF with multiple criteria? No, SUMIF only accepts one condition. Use SUMIFS for multiple criteria. For example, =SUMIFS(B2:B10,A2:A10,"Widget",C2:C10,">100") sums B where A is Widget and C is greater than 100.

Why does my SUMIF return 0? The most common reasons are: the criteria does not match any cell (check for extra spaces or different text case), the sum_range is not aligned with the range, or the criteria is entered as text when the data is numeric. Use the Evaluate Formula tool (Formulas tab > Formula Auditing) to step through the calculation.

How do I sum based on a partial match? Use wildcards in the criteria. For example, =SUMIF(A2:A10,"*East*",B2:B10) sums all cells in B where the corresponding A contains the text “East” anywhere.

Does SUMIF work with dates stored as text? It can, but only if the text exactly matches the criteria. If your dates are real dates (formatted as dates), use the DATE function in the criteria as shown above. If they are text, you may need to convert them first using DATEVALUE.

What is the difference between SUMIF and COUNTIF? SUMIF adds numeric values that meet the condition; COUNTIF counts the number of cells that meet the condition. For example, COUNTIF(A2:A10,”Widget”) returns how many times “Widget” appears, while SUMIF adds the corresponding amounts.

Can I use SUMIF across multiple sheets? Not directly. SUMIF works on a single range. To sum across sheets, use multiple SUMIF formulas added together, like =SUMIF(Sheet1!A:A,"Widget",Sheet1!B:B)+SUMIF(Sheet2!A:A,"Widget",Sheet2!B:B). Alternatively, use a 3D reference with SUMIFS if your data is structured identically.

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.