SUMIF in Excel: Sum by One Condition | 5 Examples + SUMIFS Comparison | Sheets & Cells
Function · Math

SUMIF — Sum by One Condition

Excel's original conditional-sum function. Give it a range to check, one condition, and (optionally) a different range to sum — it adds up only the values where the condition is met. The elder cousin of SUMIFS — simpler syntax when you only need one condition, but with a notorious argument-order flip that catches every Excel user at least once.

✓
Universal support since Excel 1.0
Works identically in Excel 365, 2021, 2019, 2016, 2013, 2010, 2007, 2003, Excel for the web, Google Sheets, LibreOffice, and Apple Numbers. No _xlfn. prefix. Wildcards (* and ?) work everywhere. Ship anywhere — SUMIF just works.
🎯
The argument-order flip — SUMIF vs SUMIFS
SUMIF and SUMIFS take the SAME three pieces of information but in different orders. This is the single most common Excel migration bug — muscle memory writes SUMIF but the person forgot they switched to SUMIFS (or vice versa). Learn the flip once, save yourself years of head-scratching.
SUMIF (this page)
SUMIF(range, criteria, [sum_range])
sum_range LAST, and optional. If omitted, SUMIF sums the criteria range itself. Only ONE condition supported.
SUMIFS (multi-condition)
SUMIFS(sum_range, criteria_range1, criteria1, ...)
sum_range FIRST, and required. Then pairs of criteria_range/criteria. Handles unlimited conditions.
Quick answer
SUMIF adds up values in a range where a condition on a (possibly different) range is met. Three arguments: the range to test, the criteria to test against, and — optionally — a different range whose values get summed.
Syntax
=SUMIF(range, criteria, [sum_range])
Working example
=SUMIF(SalesRep, "Emma Thompson", SalesAmount) → Returns $23,700.00 — the sum of all Emma Thompson's sales. range = SalesRep (where to CHECK the condition) criteria = "Emma Thompson" (what to LOOK for) sum_range = SalesAmount (what to ADD UP)
📗 Free SUMIF + COUNTIF + AVERAGEIF workbook
9 sheets · 18-row Q1 2026 sales log · SUMIF basics + advanced · COUNTIF · AVERAGEIF · legacy-vs-IFS comparison · legend
Download .xlsx (free) Open in Sheets
Category
Math
Difficulty
Beginner
Excel version
All (1.0+)
Modern equiv.
SUMIFS
1985
In Excel since v1.0
3
Arguments (2 required)
100%
Cross-version support
8/10
Templates using it

Syntax breakdown

SUMIF takes up to three arguments. The first two are required; the third is optional but almost always used in real formulas.

ArgumentTypeWhat it does
range REQUIRED The range where the criteria will be evaluated. Text values, numbers, dates — SUMIF checks each cell here against the criteria.
criteria REQUIRED What to look for. Can be a literal ("Emma Thompson", 5000), a comparison expression in quotes (">=5000", "<>North"), a cell reference (B2), or a wildcard pattern ("Widget*", "?im").
sum_range OPTIONAL The range whose values get summed when the criteria match. Must be the same shape as range. If omitted, SUMIF sums range itself — useful for "sum all values where the value itself meets the criteria."
The "omitted sum_range" trick: when you write =SUMIF(SalesAmount, ">=5000") — with no third argument — SUMIF treats the range as both the test AND the sum. Result: the sum of all values ≥ $5,000. Compact and elegant for numeric-threshold rollups.

Five working examples

Every example pulls from the 18-row Q1 2026 sales log in the workbook. Named ranges used throughout: SalesRep, SalesProduct, SalesRegion, SalesAmount, SalesDate.

01 Exact text match — total by sales rep

The bread-and-butter SUMIF use. "Give me Emma Thompson's total sales."

=SUMIF(SalesRep, "Emma Thompson", SalesAmount)
→ Returns $23,700.00 — Emma's four sales combined
RepSUMIF formulaTotal sales
Emma Thompson=SUMIF(SalesRep, "Emma Thompson", SalesAmount)$23,700
David Kim=SUMIF(SalesRep, "David Kim", SalesAmount)$23,200
Michael Chen=SUMIF(SalesRep, "Michael Chen", SalesAmount)$24,900
Sofia Rodriguez=SUMIF(SalesRep, "Sofia Rodriguez", SalesAmount)$12,700

The three arguments in order: where to check (SalesRep), what to look for ("Emma Thompson"), and what to sum when a match is found (SalesAmount). Read left-to-right, SUMIF walks the criteria range row by row and adds the corresponding SalesAmount whenever the rep matches.

02 Comparison operator — with sum_range OMITTED

Sum all sales at or above $5,000. Since the range being tested IS the range being summed, omit the third argument.

=SUMIF(SalesAmount, ">=5000")
→ Returns $80,500.00 — the sum of all sales that were $5,000 or more

Why omit sum_range?

The criteria (">=5000") is being tested against the SalesAmount range, and the values you want to sum ARE those same amounts. So there's no separate "range to sum" — SUMIF just adds the values that pass the test. Cleaner than writing =SUMIF(SalesAmount, ">=5000", SalesAmount), though both give the same result.

Other comparison patterns

=SUMIF(SalesAmount, "<3000")
→ Sales under $3,000 — $14,000.00
=SUMIF(SalesRep, "<>Emma Thompson", SalesAmount)
→ Everyone EXCEPT Emma — $84,700.00 (grand total minus Emma's $23,700)
Comparison operators go INSIDE quotes. Write ">=5000", not >=5000. SUMIF sees the operator as part of the criteria string and parses it. Applies to >, <, >=, <=, <> (not equal), and =.

03 Wildcards — partial text matching

Two wildcards work in text criteria: * matches any sequence of characters, ? matches exactly one character.

=SUMIF(SalesProduct, "Widget*", SalesAmount)
→ Returns $27,900.00 — sum of Widget A + Widget B sales
=SUMIF(SalesProduct, "Gadget*", SalesAmount)
→ Sum of Gadget X + Gadget Y — $46,800.00

Reps whose name starts with "S"

=SUMIF(SalesRep, "S*", SalesAmount)
→ Sofia Rodriguez only in our data — $12,700.00

Wildcard placement matters

PatternMatchesDoesn't match
"Widget*"Widget A, Widget B, WidgetronSuperWidget
"*Widget"SuperWidget, MegaWidgetWidget A, Widget B
"*Widget*"All of the aboveGadget X
"Widget ?"Widget A, Widget B (space + one char)Widget, Widget XL
Wildcards only work in text criteria, not numbers. SUMIF(SalesAmount, "5*") won't find sales starting with 5 — it'll error or return zero. For number pattern matching, convert to text with TEXT() first.

04 Cell reference criteria — parameterized SUMIF

Instead of hard-coding "Emma Thompson", point the criteria at a cell so the formula updates when the cell changes. This is how dashboards work.

=SUMIF(SalesRep, B2, SalesAmount)
→ If B2 = "Emma Thompson", returns her $23,700. Change B2 to "David Kim" and the formula returns $23,200 — no formula edit needed.

Combined with comparison operators

=SUMIF(SalesAmount, ">="&B2)
→ If B2 = 5000, sums sales ≥ $5,000. The & concatenates the operator string with the cell value. Note the operator IS in quotes; the cell reference is NOT.
The & concatenation is essential for dynamic thresholds. You cannot write ">=B2" — SUMIF would look for the literal text ">=B2" and find nothing. You must build the criteria string: ">="&B2 becomes ">=5000" at evaluation time, which is what SUMIF needs.

05 Date-based criteria (single side)

"Sum all sales from February onward." Since it's ONE condition (a lower bound), SUMIF handles it — but a full date range needs SUMIFS.

=SUMIF(SalesDate, ">="&DATE(2026,2,1), SalesAmount)
→ Returns $67,700.00 — Feb + March 2026 total

Two-sided date range needs SUMIFS

=SUMIFS(SalesAmount, SalesDate, ">="&DATE(2026,1,1), SalesDate, "<="&DATE(2026,1,31))
→ January-only sales — $40,700.00. SUMIF can't do this because it's TWO conditions on the same range.
The moment you need TWO conditions, you need SUMIFS. SUMIF is strictly single-condition. This is the primary reason to migrate from SUMIF to SUMIFS — even for simple "between X and Y" ranges, only the multi-condition version works.

Interactive playground

Try it Live SUMIF demonstration

Mirrors live cells from the workbook. Edit the yellow input → the blue answer updates.

Input · Rep name
Michael Chen
Output · Total sales
$24,900.00
=SUMIF(SalesRep, B2, SalesAmount)
Input · Threshold
5000
Output · Sum ≥ threshold
$80,500.00
=SUMIF(SalesAmount, ">="&B2)

Download the workbook to try SUMIF patterns across the full 18-row sales log.

SUMIF vs SUMIFS — the same question, both ways

Same result. Different argument order.

Every SUMIF query can be rewritten as SUMIFS — you just move sum_range from the end to the beginning. Six worked comparisons from the workbook:

QuestionLegacy — SUMIFModern — SUMIFS
Emma Thompson total
=SUMIF(SalesRep, "Emma Thompson", SalesAmount)
→ $23,700.00
=SUMIFS(SalesAmount, SalesRep, "Emma Thompson")
→ $23,700.00
Widget A total
=SUMIF(SalesProduct, "Widget A", SalesAmount)
→ $12,800.00
=SUMIFS(SalesAmount, SalesProduct, "Widget A")
→ $12,800.00
North region sales
=SUMIF(SalesRegion, "North", SalesAmount)
→ $23,700.00
=SUMIFS(SalesAmount, SalesRegion, "North")
→ $23,700.00
All "Widget" products
=SUMIF(SalesProduct, "Widget*", SalesAmount)
→ $27,900.00
=SUMIFS(SalesAmount, SalesProduct, "Widget*")
→ $27,900.00
Sales ≥ $5,000
=SUMIF(SalesAmount, ">=5000")
→ $80,500.00
=SUMIFS(SalesAmount, SalesAmount, ">=5000")
→ $80,500.00
Two conditions (rep AND product)
SUMIF cannot do this — only one condition
=SUMIFS(SalesAmount, SalesRep, "Emma Thompson", SalesProduct, "Widget A")
→ $3,200.00

The pattern: SUMIF's (range, criteria, sum_range) becomes SUMIFS's (sum_range, range, criteria). SUMIFS then lets you add more range, criteria pairs for additional conditions. Same three arguments in the single-condition case, just rearranged.

SUMIF or SUMIFS — which one should you use?

The practical answer

Both work. Both are universally supported. The choice comes down to how many conditions you expect NOW — and whether you might need more later.

USE SUMIF WHEN…

  • You have exactly ONE condition and know it will stay that way.
  • You want to sum a range based on a threshold on that same range (the omitted sum_range trick — SUMIFS can't do this cleanly).
  • You're maintaining an old workbook that already uses SUMIF everywhere and don't want to introduce inconsistency.
  • Readability matters and one condition really is enough — SUMIF reads slightly more naturally for the simple case.

USE SUMIFS WHEN…

  • You have TWO OR MORE conditions. SUMIF simply can't do this.
  • You might add conditions later. SUMIFS scales without rewriting.
  • You want consistent syntax across your workbook — SUMIFS handles both the 1-condition and N-condition cases.
  • You're already using COUNTIFS and AVERAGEIFS — matching the family reduces cognitive load.

Our recommendation: if you're writing formulas today and have any doubt, use SUMIFS. It handles every SUMIF case AND scales to more conditions. But SUMIF isn't going anywhere — every version of Excel supports it, and it's the right choice for many everyday tasks.

Common errors and how to fix them

ResultWhy it happensBroken → Fix
Returns 0 The criteria string doesn't match anything (typo, wrong case in some contexts, extra whitespace). =SUMIF(SalesRep, "emma thompson", SalesAmount) // 0 in some cases =SUMIF(SalesRep, "Emma Thompson", SalesAmount)
VALUE error Wildcards used against a numeric range. =SUMIF(SalesAmount, "5*", SalesAmount) // wildcards don't work on numbers =SUMIF(SalesAmount, ">=5000", SalesAmount)
Wrong total range and sum_range are different shapes. =SUMIF(A2:A20, "X", B2:B15) // ranges don't match =SUMIF(A2:A20, "X", B2:B20) // same size
Cell ref as text Comparison operator got jammed against a cell reference without the &. =SUMIF(SalesAmount, ">=B2") // looks for literal ">=B2" =SUMIF(SalesAmount, ">="&B2)
Argument order Wrote SUMIFS-style order — sum_range first — but function is SUMIF. =SUMIF(SalesAmount, SalesRep, "Emma Thompson") // wrong function shape =SUMIF(SalesRep, "Emma Thompson", SalesAmount)
Text-number mismatch Numeric range contains text-formatted numbers. SUMIF returns 0 when numbers are stored as text Convert with VALUE() or Text-to-Columns first
📗 Every example above, in one workbook
Exact match · comparison operators · wildcards · cell references · date criteria · SUMIF-vs-SUMIFS comparison sheet.
Download legacy-ifs-examples-2026.xlsx

Related functions

Complementary functions

Excel version compatibility

SUMIF has been in Excel since version 1.0 (1985). Every platform supports it identically:

PlatformSupports SUMIF?Notes
Excel 365 (Windows & Mac)✓ YesFull support
Excel 2021 / 2019 / 2016 / 2013 / 2010 / 2007 / 2003✓ YesFull support
Excel for the web✓ YesFull support
Excel on iPad & iPhone✓ YesFull support
Google Sheets✓ YesSame syntax
LibreOffice Calc✓ YesFull support
Apple Numbers✓ YesFull support

How to write a SUMIF from scratch

  1. Identify the range you want to TEST

    What column or range holds the values you're checking against a condition? That's the first argument.

  2. Write the criteria

    Exact text goes in quotes: "Emma Thompson". Comparisons include the operator in the quotes: ">=5000". Cell references stay bare: B2. Combined: ">="&B2.

  3. Decide if you need a separate sum_range

    If the values you're testing ARE the values you want to sum (like "sum all amounts ≥ 5000"), omit sum_range. Otherwise pass it as the third argument.

  4. Verify sum_range shape matches range

    If range is 20 rows, sum_range must also be 20 rows. Mismatched shapes cause subtle bugs — SUMIF may quietly use only the first N cells of sum_range.

  5. If you need a second condition — stop and switch to SUMIFS

    SUMIF fundamentally handles ONE condition. Two-sided ranges (like a date window) require SUMIFS. Migrate the whole formula, remembering the argument-order flip.

Functions used with SUMIF

🎁 Grab the free SUMIF + COUNTIF + AVERAGEIF workbook
9 sheets covering everything on this page — basics, wildcards, comparison operators, plus the full legacy-vs-IFS side-by-side comparison.
Download legacy-ifs-examples-2026.xlsx

Frequently asked questions

What's the difference between SUMIF and SUMIFS?

SUMIF handles ONE condition; SUMIFS handles multiple. And the argument order is FLIPPED: SUMIF puts sum_range LAST (optional), while SUMIFS puts sum_range FIRST (required). Both are universally supported since Excel 2007+.

Can SUMIF handle multiple conditions?

No. SUMIF is fundamentally single-condition. The moment you need "X AND Y" — like a date range with both start and end, or "rep = Emma AND product = Widget A" — you must switch to SUMIFS.

What happens if I omit the sum_range?

SUMIF sums the criteria range itself. Useful when you want "sum of all values ≥ 5000" — the range being tested IS the range being summed. This trick only works with SUMIF, not SUMIFS.

Do wildcards work in SUMIF?

Yes — * matches any sequence of characters, ? matches exactly one. Only work in TEXT criteria, not numeric ranges. SUMIF(SalesProduct, "Widget*", SalesAmount) sums Widget A + Widget B combined.

How do I use SUMIF with a cell reference for the criteria?

Just pass the cell reference as the second argument: =SUMIF(SalesRep, B2, SalesAmount). Whatever's in B2 becomes the criteria. For comparison operators with a cell, use & to concatenate: =SUMIF(SalesAmount, ">="&B2).

Is SUMIF case-sensitive?

No. SUMIF treats "Emma", "emma", and "EMMA" as the same. For case-sensitive conditional sums, use SUMPRODUCT with EXACT: =SUMPRODUCT((EXACT(SalesRep, "Emma Thompson"))*SalesAmount).

Does SUMIF work in Google Sheets?

Yes, identically. Same syntax in Google Sheets, LibreOffice, and Apple Numbers.

Why is my SUMIF returning zero?

Most common causes: the criteria text has extra whitespace ("Emma " vs "Emma"), numbers in the range are stored as text (fix with VALUE or Text-to-Columns), or you tried wildcards on a numeric range (they only work on text).

How do I write "not equal" in SUMIF criteria?

Use "<>": =SUMIF(SalesRep, "<>Emma Thompson", SalesAmount) sums everyone except Emma. Combine with cell references: "<>"&B2.

Should I always use SUMIFS instead of SUMIF?

Reasonable default, yes. SUMIFS handles both cases and scales. But SUMIF's "omit sum_range" trick is genuinely useful for numeric-threshold sums, and SUMIF reads slightly better for one-condition cases. Both are fine — just pick a convention for your workbook.

What's the difference between SUMIF and SUMPRODUCT?

SUMPRODUCT is more flexible — it can handle multiple conditions, array operations, and case-sensitive matching. But it's harder to read. Use SUMIF for readable conditional sums; reach for SUMPRODUCT when SUMIF/SUMIFS can't express what you need.

Which templates use SUMIF?

Most templates that roll up numbers by category. Prominently: Budget Tracker (sum by expense category), Invoice (sum by line-item type), Sales Dashboard (sum by rep), KPI Dashboard (sum by metric), Expense Report (sum by category), Timesheet (sum by project), Inventory Tracker (sum by location), and Employee Attendance (sum hours per employee).

Templates that use SUMIF

8 of our 10 templates use SUMIF for rolling up numbers by category:

Skip the syntax. Ask in plain English.

The Sheets & Cells AI Add-in writes SUMIF, SUMIFS, and every conditional-sum pattern — right inside Excel. Type "sum sales by rep" and get the working formula, ready to paste. It even knows the argument-order flip so you don't have to.

Try the AI Add-in →