How SUMIF works
SUMIF walks down a column, checks each cell against a condition, and adds up the matching values. The condition can be a literal value ("Office"), a comparison (">1000"), or a wildcard pattern ("Marketing*").
There are two columns involved: the column being checked, and the column being summed. They're often different (look at column B for the category, sum column C for the amount), but they can be the same when you skip the third argument.
SUMIFS is the multi-condition version. The argument order is reversed: the sum_range comes first, then pairs of (range, criteria). You can keep adding pairs for as many conditions as you need.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
| range | range | ✓ Required | The column being checked against the criteria. Often whole-column like B:B so new rows get included automatically. |
| criteria | any | ✓ Required | The condition. Literal value ("Office"), comparison wrapped in quotes (">1000"), or wildcard pattern ("MKT-*"). Use & to splice in a cell value: ">"&E2. |
| sum_range | range | ✗ Optional | The column being summed. If omitted, SUMIF sums the same column it's checking. Must be the same shape as range, ideally the same height. |
| Argument | Type | Required | Description |
|---|---|---|---|
| sum_range | range | ✓ Required | The column being summed. SUMIFS puts this FIRST (different from SUMIF). What numbers Excel will add up if every condition matches. |
| criteria_range1 | range | ✓ Required | The first column being checked. |
| criteria1 | any | ✓ Required | The first condition. Same shape as SUMIF's criteria. |
| criteria_range2, criteria2, ... | pairs | ✗ Optional | Additional (range, criteria) pairs. Up to 127 pairs. All conditions must be true (AND, never OR). |
SUMIF basic: total expenses by category
You're closing the books on Q1. The expense log has every transaction tagged with a category. The CFO wants a single number for office supplies. One SUMIF gives it to you in a heartbeat, no matter how many rows are on the log.
=SUMIF(B:B,"Office",C:C)- •
B:B→ the column being checked (the Category column) - •
"Office"→ the condition: only sum rows tagged Office - •
C:C→ the column being summed (the Amount column) - •
Whole columns→ B:B and C:C let the formula keep working as new rows are added
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Date | Category | Amount | Category | Total | ||
| 2 | 2024-03-04 | Office | $340 | Office | $1,830 | ||
| 3 | 2024-03-05 | Travel | $1,250 | Travel | $3,820 | ↓ next category | |
| 4 | 2024-03-06 | Office | $185 | Software | $2,150 | ||
| 5 | 2024-03-07 | Software | $899 | Meals | $640 | ||
| 6 | 2024-03-08 | Meals | $240 | ||||
| 7 | 2024-03-09 | Office | $420 | ||||
| 8 | 2024-03-10 | Travel | $2,570 | ||||
| 9 | 2024-03-11 | Software | $1,251 | ||||
| 10 | 2024-03-12 | Office | $885 | ||||
| 11 | 2024-03-13 | Meals | $400 |
SUMIF with a comparison: total of every sale over $1,000
The criteria don't have to be a literal match. Wrap a comparison operator in quotes and SUMIF will sum the matching numeric values. This is the cleanest way to ask questions like "how much revenue came from large-ticket deals?"
=SUMIF(B:B,">1000")- •
B:B→ the column of sale amounts - •
">1000"→ the comparison, wrapped in quotes - •
No third argument→ when sum_range is omitted, SUMIF sums the same range it checked - •
Operators→ use >, <, >=, <=, =, <> all wrapped in quotes
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Order | Amount | Big-ticket total | Result | ||
| 2 | PO-1001 | $450 | Sales over $1,000 | $13,820 | ||
| 3 | PO-1002 | $2,400 | ||||
| 4 | PO-1003 | $890 | ||||
| 5 | PO-1004 | $3,150 | ||||
| 6 | PO-1005 | $1,250 | ||||
| 7 | PO-1006 | $700 | ||||
| 8 | PO-1007 | $5,020 | ||||
| 9 | PO-1008 | $320 | ||||
| 10 | PO-1009 | $2,000 | ||||
| 11 | PO-1010 | $580 |
SUMIF with wildcards: total spend by department prefix
Department codes in your GL system follow a pattern. Marketing accounts all start with "MKT-". Engineering with "ENG-". The wildcard character * matches any number of characters, so you can sum every row that starts with the same prefix.
=SUMIF(A:A,"MKT-*",B:B)- •
A:A→ the department-code column - •
"MKT-*"→ matches MKT- followed by anything: MKT-001, MKT-DIGITAL, MKT-Q3, etc. - •
B:B→ the amount column being summed - •
? wildcard→ matches exactly one character (less common but useful) - •
~ escape→ use ~* to match a literal asterisk if your data contains them
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Account | Spend | Marketing total | Result | ||
| 2 | MKT-DIGITAL | $8,400 | Anything starting "MKT-" | $24,950 | ||
| 3 | ENG-PLATFORM | $15,200 | ||||
| 4 | MKT-EVENTS | $5,800 | ||||
| 5 | OPS-FACILITIES | $3,200 | ||||
| 6 | MKT-PR | $4,250 | ||||
| 7 | ENG-MOBILE | $11,000 | ||||
| 8 | MKT-CONTENT | $3,100 | ||||
| 9 | HR-PAYROLL | $2,800 | ||||
| 10 | MKT-PARTNERSHIPS | $3,400 | ||||
| 11 | OPS-IT | $6,700 |
SUMIFS: Q1 revenue by region (two conditions)
Real reports rarely depend on one filter. The CFO doesn't want all Q1 revenue, she wants Q1 revenue in the North region. SUMIFS handles that with a (range, criteria) pair for each condition. Watch the argument order: the sum_range comes first, not last.
=SUMIFS(D:D,A:A,"North",B:B,"Q1")- •
D:D→ the sum_range: what you're adding (Revenue) - •
A:A, "North"→ first condition: Region = North - •
B:B, "Q1"→ second condition: Quarter = Q1 - •
Pair pattern→ every additional condition is another (range, criteria) pair - •
AND, not OR→ SUMIFS only sums rows where all conditions are true
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Region | Quarter | Product | Revenue | North Q1 total | ||
| 2 | North | Q1 | Pro | $28,400 | $71,800 | ||
| 3 | South | Q1 | Pro | $31,200 | |||
| 4 | North | Q2 | Pro | $29,800 | |||
| 5 | North | Q1 | Lite | $14,200 | |||
| 6 | East | Q1 | Lite | $11,500 | |||
| 7 | North | Q3 | Pro | $33,100 | |||
| 8 | South | Q1 | Lite | $12,800 | |||
| 9 | North | Q1 | Enterprise | $29,200 | |||
| 10 | West | Q1 | Pro | $22,400 | |||
| 11 | North | Q4 | Lite | $13,900 | |||
| 12 | East | Q2 | Pro | $24,600 | |||
| 13 | West | Q3 | Lite | $9,800 |
SUMIFS with a date range: revenue between two dates
A common reporting question is "how much did we sell between two dates?" SUMIFS handles this by using the same column twice with two different comparisons: greater than or equal to the start date, and less than the day after the end date.
=SUMIFS(C:C,A:A,">="&DATE(2024,1,1),A:A,"<"&DATE(2024,4,1))- •
C:C→ the sum_range: Revenue - •
A:A, ">="&DATE(2024,1,1)→ first condition: date is on or after Jan 1, 2024 - •
A:A, "<"&DATE(2024,4,1)→ second condition: date is before April 1, 2024 - •
Same column twice→ SUMIFS lets you reference the same range with multiple criteria - •
DATE() function→ writes 2024-01-01 as a real date instead of risky text comparison
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Date | Customer | Revenue | Q1 2024 | ||
| 2 | 2023-12-28 | Acme Corp | $8,400 | $54,320 | ||
| 3 | 2024-01-15 | Initech | $12,800 | |||
| 4 | 2024-02-04 | Pied Piper | $6,200 | |||
| 5 | 2024-02-18 | Hooli | $15,400 | |||
| 6 | 2024-03-09 | Acme Corp | $9,800 | |||
| 7 | 2024-03-31 | Initech | $10,120 | |||
| 8 | 2024-04-01 | Hooli | $22,000 | |||
| 9 | 2024-04-15 | Pied Piper | $7,500 | |||
| 10 | 2024-05-08 | Acme Corp | $11,200 | |||
| 11 | 2024-06-12 | Initech | $8,900 |
SUMIF vs SUMIFS: the argument order
The most confusing thing about these two functions is that the sum_range argument lives in different positions. Get this wrong and Excel either errors out or, worse, returns a wrong number with no warning.
Where people go wrong
- Swapping SUMIF and SUMIFS argument order
You write =SUMIFS(A:A,B:B,>1000) by muscle memory from SUMIF and end up summing the wrong column. SUMIFS puts the sum_range first, not last.
Fix: When in doubt, type SUMIFS( and read the tooltip Excel pops up. The first argument is always sum_range. Then pairs. - Forgetting quotes around comparison criteria
Writing =SUMIF(B:B,>1000) without the quotes returns a #NAME? error. Excel can't parse a bare comparison operator outside a string.
Fix: Wrap the entire criteria in quotes: ">1000". For dynamic comparisons, use the ampersand: ">"&E2. - Mismatched range sizes
SUMIF(B2:B100, ..., C2:C50) silently returns wrong results because the sum_range and the criteria range don't line up. SUMIFS errors out with #VALUE!
Fix: Use whole columns (B:B and C:C) when you can. They auto-grow with new data and there's no chance of mismatch. - Wildcards on numeric ranges
Trying =SUMIF(B:B,"1*",C:C) to match any number starting with 1 doesn't work. Wildcards only apply to text, and Excel stores numbers as numbers.
Fix: Use comparison operators instead: ">=10" and "<20" for numbers in the teens. For text-formatted numbers, fix the data type at the source first.
Notes
- SUMIF was introduced in Excel 2003. SUMIFS arrived in Excel 2007. Both work in every modern version
- Wildcards in criteria: * matches any sequence of characters, ? matches exactly one character. Escape with ~ to match a literal asterisk or question mark
- Comparison operators in criteria must be wrapped in quotes: ">100", "<>0", ">="&E2 to splice a cell value
- Both functions are case-insensitive when comparing text: "office" matches "Office" and "OFFICE"
- An empty criteria string ("") matches blank cells. Use "<>" to match every non-blank cell
- When no rows match, both functions return 0 (not an error). Wrap in IFERROR only if your sum_range itself contains errors
- Whole-column references (B:B) are convenient and Excel optimises them well, but on millions of rows you may see a small slowdown compared to a tight range
Now prove it
Reading about SUMIFS is one thing.
Writing one in front of your CFO when the board meeting is in twenty minutes and the regional breakdown isn't matching is completely different.
These exercises put you in real reporting scenarios where one well-structured SUMIFS saves the morning.
Here's the thing about SUMIFS.
You can read this page twice and still freeze when the CFO drops a 50,000-row transaction log on your desk and asks for revenue by region by quarter by product, with a preview deck due before lunch.
That gap, between knowing what SUMIFS does and being able to fly through one cleanly under pressure, is exactly what CellSkill is built to close.
Not with more reading.
With practice on scenarios that look like your actual job.
Start practicing SUMIFS for free →