SUMIF & SUMIFS

Add the cells specified by a given condition. SUMIFS handles multiple conditions at once, so the two functions are almost always learned together.

Math & StatsBeginner
Purpose
Add up the cells that meet a condition. SUMIF for one condition, SUMIFS for two or more.
Returns
A single number: the total of every cell that matched
SUMIF syntax
=SUMIF(range, criteria, [sum_range])
SUMIFS syntax
=SUMIFS(sum_range, range1, criteria1, ...)

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.

= SUMIF(range, criteria, [sum_range])

Arguments

SUMIF
ArgumentTypeRequiredDescription
rangerange✓ RequiredThe column being checked against the criteria. Often whole-column like B:B so new rows get included automatically.
criteriaany✓ RequiredThe condition. Literal value ("Office"), comparison wrapped in quotes (">1000"), or wildcard pattern ("MKT-*"). Use & to splice in a cell value: ">"&E2.
sum_rangerange✗ OptionalThe column being summed. If omitted, SUMIF sums the same column it's checking. Must be the same shape as range, ideally the same height.
SUMIFS
ArgumentTypeRequiredDescription
sum_rangerange✓ RequiredThe column being summed. SUMIFS puts this FIRST (different from SUMIF). What numbers Excel will add up if every condition matches.
criteria_range1range✓ RequiredThe first column being checked.
criteria1any✓ RequiredThe first condition. Same shape as SUMIF's criteria.
criteria_range2, criteria2, ...pairs✗ OptionalAdditional (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
F2
fx
=SUMIF(B:B,"Office",C:C)
ABCDEFG
1DateCategoryAmountCategoryTotal
22024-03-04Office$340Office$1,830
32024-03-05Travel$1,250Travel$3,820↓ next category
42024-03-06Office$185Software$2,150
52024-03-07Software$899Meals$640
62024-03-08Meals$240
72024-03-09Office$420
82024-03-10Travel$2,570
92024-03-11Software$1,251
102024-03-12Office$885
112024-03-13Meals$400
Formula entered in cell F2. Same shape works for every category by changing the criteria.
Four rows are tagged Office (highlighted green), totaling $1,830. The result lookup table on the right lists totals for every category, each one a separate SUMIF.

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
E2
fx
=SUMIF(B:B,">1000")
ABCDEF
1OrderAmountBig-ticket totalResult
2PO-1001$450Sales over $1,000$13,820
3PO-1002$2,400
4PO-1003$890
5PO-1004$3,150
6PO-1005$1,250
7PO-1006$700
8PO-1007$5,020
9PO-1008$320
10PO-1009$2,000
11PO-1010$580
Formula entered in cell E2 to keep it out of the way of the data on the left.
Five rows beat the $1,000 bar (highlighted green), totaling $13,820. The other five rows are below the threshold and contribute nothing.
To compare against a cell instead of a literal, use the ampersand to splice it: =SUMIF(B:B,">"&E2) sums everything bigger than the value in E2.

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
E2
fx
=SUMIF(A:A,"MKT-*",B:B)
ABCDEF
1AccountSpendMarketing totalResult
2MKT-DIGITAL$8,400Anything starting "MKT-"$24,950
3ENG-PLATFORM$15,200
4MKT-EVENTS$5,800
5OPS-FACILITIES$3,200
6MKT-PR$4,250
7ENG-MOBILE$11,000
8MKT-CONTENT$3,100
9HR-PAYROLL$2,800
10MKT-PARTNERSHIPS$3,400
11OPS-IT$6,700
Formula entered in cell E2.
Five rows match MKT-* (highlighted green), totaling $24,950. The other six departments are excluded by the wildcard.

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
F2
fx
=SUMIFS(D:D,A:A,"North",B:B,"Q1")
ABCDEFG
1RegionQuarterProductRevenueNorth Q1 total
2NorthQ1Pro$28,400$71,800
3SouthQ1Pro$31,200
4NorthQ2Pro$29,800
5NorthQ1Lite$14,200
6EastQ1Lite$11,500
7NorthQ3Pro$33,100
8SouthQ1Lite$12,800
9NorthQ1Enterprise$29,200
10WestQ1Pro$22,400
11NorthQ4Lite$13,900
12EastQ2Pro$24,600
13WestQ3Lite$9,800
Formula entered in cell F2.
Three rows match BOTH conditions (region North AND quarter Q1), shown in green. Their sum is $71,800. Every other row fails at least one condition and contributes nothing.

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
E2
fx
=SUMIFS(C:C,A:A,">="&DATE(2024,1,1),A:A,"<"&DATE(2024,4,1))
ABCDEF
1DateCustomerRevenueQ1 2024
22023-12-28Acme Corp$8,400$54,320
32024-01-15Initech$12,800
42024-02-04Pied Piper$6,200
52024-02-18Hooli$15,400
62024-03-09Acme Corp$9,800
72024-03-31Initech$10,120
82024-04-01Hooli$22,000
92024-04-15Pied Piper$7,500
102024-05-08Acme Corp$11,200
112024-06-12Initech$8,900
Formula entered in cell E2. The two conditions both reference column A.
Five dates fall in Q1 2024 (highlighted in blue, matching revenue in green), totaling $54,320. The Dec 28 row is excluded because it's still 2023, and April onward is excluded by the strict less-than on April 1.
Use strict less-than against the day AFTER your end date, not less-than-or-equal against the end date itself. Dates in Excel can include time stamps, so 2024-03-31 stored as 2024-03-31 14:00 would be excluded by <=DATE(2024,3,31).

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.

SUMIF
SUMIF(range, criteria, [sum_range])
sum_range is last and optional. When omitted, SUMIF sums the same column it just checked.
SUMIFS
SUMIFS(sum_range, range1, criteria1, ...)
sum_range is first and required. Then pairs of (range, criteria) for as many conditions as you need.
Mnemonic: SUMIFS with the S has the Sum_range up front. The plural version puts the sum first because there's only one of them, and the criteria come in unlimited pairs.

Where people go wrong

  1. 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.
  2. 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.
  3. 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.
  4. 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 →
Free account · No credit card · Cancel anytime
Practice SUMIF
SUMIF & SUMIFS in Excel: Formula, Examples, Free Practice · CellSkill