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.
_xlfn. prefix. Wildcards (* and ?) work everywhere. Ship anywhere — SUMIF just works.Syntax breakdown
SUMIF takes up to three arguments. The first two are required; the third is optional but almost always used in real formulas.
| Argument | Type | What 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." |
=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."
| Rep | SUMIF formula | Total 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.
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
">=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.
Reps whose name starts with "S"
Wildcard placement matters
| Pattern | Matches | Doesn't match |
|---|---|---|
| "Widget*" | Widget A, Widget B, Widgetron | SuperWidget |
| "*Widget" | SuperWidget, MegaWidget | Widget A, Widget B |
| "*Widget*" | All of the above | Gadget X |
| "Widget ?" | Widget A, Widget B (space + one char) | Widget, Widget XL |
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.
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
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.& 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.
Two-sided date range needs SUMIFS
Interactive playground
Try it Live SUMIF demonstration
Mirrors live cells from the workbook. Edit the yellow input → the blue answer updates.
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:
| Question | Legacy — SUMIF | Modern — 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_rangetrick — 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
| Result | Why it happens | Broken → 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 |
Related functions
Complementary functions
Excel version compatibility
SUMIF has been in Excel since version 1.0 (1985). Every platform supports it identically:
| Platform | Supports SUMIF? | Notes |
|---|---|---|
| Excel 365 (Windows & Mac) | ✓ Yes | Full support |
| Excel 2021 / 2019 / 2016 / 2013 / 2010 / 2007 / 2003 | ✓ Yes | Full support |
| Excel for the web | ✓ Yes | Full support |
| Excel on iPad & iPhone | ✓ Yes | Full support |
| Google Sheets | ✓ Yes | Same syntax |
| LibreOffice Calc | ✓ Yes | Full support |
| Apple Numbers | ✓ Yes | Full support |
How to write a SUMIF from scratch
-
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.
-
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. -
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.
-
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.
-
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
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 →