How to Use SUMIF in Excel (Sum with One Condition + Free Generator)

Adds the cells specified by a given condition or criteria.

Generated Formula
=SUMIF(range, criteria)

Learning Resources

Want to master Excel? Check out this Top-Rated Course.

How to Use SUMIF in Excel and Google Sheets

The SUMIF function sums numeric values that meet a single condition — like "sum all sales where the region is North" or "sum expenses over $500." It is one of the most practical tools for financial analysis, sales reporting, and budget tracking.

SUMIF Syntax

=SUMIF(range, criteria, [sum_range])

  • range — The cells you want to evaluate against the criteria.
  • criteria — The condition that determines which cells to sum (text, number, expression, or cell reference).
  • sum_range — The actual cells to sum. If omitted, SUMIF sums the range itself.

Step-by-Step Example: Sum Sales by Region

Suppose you have a sales table:

A (Region)B (Sales)
North1,200
South850
North2,300
East1,100
North950

Goal: Total sales for the North region.

  1. Click cell D2 (or any empty cell).
  2. Enter: =SUMIF(A2:A6, "North", B2:B6)
  3. Press Enter. The result is 4,450 (1,200 + 2,300 + 950).

To make the criteria dynamic, put "North" in cell E1 and use: =SUMIF(A2:A6, E1, B2:B6). Update E1 to "South" and the result instantly changes to 850.

More Real-World SUMIF Examples

Sum amounts greater than 500:

=SUMIF(B:B, ">500")

Sum with a cell reference as criteria:

=SUMIF(A:A, E1, B:B)

Sum excluding a specific item:

=SUMIF(A:A, "<>Widget", B:B)

Sum with comparison operator + cell reference:

=SUMIF(C:C, ">="&D1, B:B)

Using Wildcards with SUMIF

Wildcards let you match partial text:

  • * (asterisk) — matches any sequence of characters. =SUMIF(A:A, "*East*", B:B) sums all rows where column A contains "East" anywhere (includes "Northeast", "Eastern").
  • ? (question mark) — matches any single character. =SUMIF(A:A, "??-100", B:B) matches "AB-100" but not "ABC-100".
  • ~ (tilde) — escape wildcards. =SUMIF(A:A, "~*", B:B) sums rows where column A contains a literal asterisk.

Summing with Date Criteria

SUMIF handles date conditions using DATE() or cell references:

=SUMIF(A:A, ">="&DATE(2025,1,1), B:B)

This sums all values in column B where the date in column A is on or after January 1, 2025. For a two-date range (between start and end), use SUMIFS:

=SUMIFS(B:B, A:A, ">="&E1, A:A, "<="&F1)

SUMIF vs SUMIFS: When to Use Each

FeatureSUMIFSUMIFS
Conditions1Up to 127
Argument orderrange, criteria, sum_rangesum_range, criteria_range1, criteria1, ...
Sum_range optional?YesNo (required)
Best forSimple single-condition sumsMulti-condition sums (e.g., region + product + date)

Common SUMIF Edge Cases

  • Data type mismatch: Numbers stored as text won't match numeric criteria. Use VALUE() or TEXT() to align types.
  • Sum_range sizes differ: If sum_range is smaller than range, SUMIF only sums the overlapping top-left portion. Always match sizes.
  • Leading/trailing spaces: =SUMIF(A:A, "Apple", B:B) won't match " Apple". Use TRIM() on your data or criteria: "="&TRIM(E1).
  • Case sensitivity: SUMIF is not case-sensitive. "APPLE", "Apple", and "apple" all match.
  • Criteria longer than 255 characters: SUMIF rejects criteria strings longer than 255 characters. For longer patterns, use a helper column or switch to SUMIFS with SUMPRODUCT.

Pro Tip: Use wildcards for flexible matching. =SUMIF(A:A, "*Widget*", B:B) sums all rows where column A contains "Widget" anywhere in the text. Combine with a cell reference: =SUMIF(A:A, "*"&E1&"*", B:B) — typing "Widget" in E1 instantly updates the sum.

Common Errors & Fixes

  • SUMIF returns 0 or wrong sum

    Causes:
    • Criteria not in quotes for text (e.g. "Apple" not Apple).
    • Sum_range and range different sizes; only overlapping rows are summed.
    • Number stored as text in range; criteria does not match.
    Fixes:
    • Use quotes for text: ">100", "Sales".
    • Make sum_range same size as range, or omit sum_range to sum range.
    • Align data types; use VALUE or TEXT as needed.

Frequently Asked Questions

What is the difference between SUMIF and SUMIFS?

SUMIF handles a single condition. SUMIFS handles multiple conditions (up to 127) and puts the sum_range first. Use SUMIF for simple one-criteria sums. Use SUMIFS when you need to sum by multiple criteria like region AND product AND date range.

Can SUMIF use wildcards?

Yes. Use * (asterisk) for any sequence of characters and ? (question mark) for a single character. Example: =SUMIF(A:A,"*apple*",B:B) sums column B where column A contains "apple" anywhere. Use ~ to escape wildcards: =SUMIF(A:A,"~*",B:B) sums rows with a literal asterisk.

How do I sum with a date criteria?

Use a cell reference or DATE() in criteria: =SUMIF(A:A,">="&DATE(2025,1,1),B:B) sums B where A is on or after Jan 1, 2025. For a date range (between two dates), use SUMIFS with two conditions: =SUMIFS(B:B,A:A,">="&E1,A:A,"<="&F1).

Why does SUMIF return 0?

Common causes: (1) Criteria not matching data type — text stored as numbers or vice versa. Use quotes for text criteria. (2) Extra spaces in cells — use TRIM(). (3) Sum_range misaligned with range — ensure they are the same size. (4) Criteria string exceeds 255 characters.

How do I sum blank or non-blank cells with SUMIF?

To sum values where a cell is blank, use "=" as criteria: =SUMIF(A:A,"=",B:B). For non-blank cells, use "<>": =SUMIF(A:A,"<>",B:B). Both treat truly empty cells and cells containing only spaces differently — consider combining with TRIM for clean results.

When should I use SUMIF vs COUNTIF?

Use SUMIF to add numeric values that meet a condition. Use COUNTIF to count how many cells meet a condition. Both use the same criteria syntax with text, numbers, wildcards, and date comparisons.

How do I use a cell reference as the criteria in SUMIF?

Concatenate the operator with the cell reference using &: =SUMIF(A:A,">"&E1,B:B). For exact match, reference the cell directly: =SUMIF(A:A,E1,B:B). This lets you change the criteria without editing the formula.

Why is SUMIF returning a wrong sum instead of an error?

SUMIF silently skips mismatches instead of erroring. Check these: (1) sum_range and range must be the same size — different sizes use only the overlapping portion. (2) Numeric values stored as text are ignored. (3) Hidden characters in criteria or data cells — use LEN() to verify character counts.

Related Formulas

Explore related formula generators to solve similar problems

Want to become an Excel Pro?

Stop searching for formulas. Master Excel in 30 days with this top-rated course.

Learn More