COUNTIF vs SUMIF: counting rows vs adding values
Same 'if' idea, two different questions. COUNTIF answers 'how many rows match?' — it tallies cells. SUMIF answers 'what's the total of the values in matching rows?' — it adds a second column. Mixing them up is why a report shows 12 when you wanted $4,300, or vice-versa.
The differences at a glance
| COUNTIF | SUMIF | |
|---|---|---|
| What it returns | A count of matching cells | The sum of values in matching rows |
| Columns involved | One (the range you test) | Two (the range you test + the range you add) |
| Argument order | range, criteria | range, criteria, [sum_range] — sum_range LAST (opposite of SUMIFS) |
| Same-column shortcut | N/A | Omit sum_range to sum the tested column itself: =SUMIF(A:A,">100") |
| Multi-condition sibling | COUNTIFS | SUMIFS (sum_range moves to FIRST) |
| Compatibility | Universal | Universal — identical in every version of all three apps we test |
Which should you use?
- COUNTIF — You want a headcount: how many orders are 'East', how many scores are ≥90, how many cells contain 'error'. Only the test column matters.
- SUMIF — You want a filtered total: total sales for 'East', total hours on Project X. You're adding up a value column based on a condition in another (or the same) column.
Compatibility (from executed tests)
Both run correctly in every version of all three apps we test. The one true trap isn't compatibility — it's argument order: SUMIF puts the optional sum_range LAST, while its multi-condition upgrade SUMIFS puts sum_range FIRST. COUNTIF has no such column, so switching to COUNTIFS is painless. When in doubt, jump straight to COUNTIFS / SUMIFS for consistent syntax.
Example formulas
| COUNTIF — how many 'East' rows | =COUNTIF(A2:A100,"East") |
| SUMIF — total sales for 'East' | =SUMIF(A2:A100,"East",C2:C100) |
| SUMIF — sum the column itself where >100 | =SUMIF(C2:C100,">100") |
Full per-version details on each function page: COUNTIF · SUMIF.
See also: COUNTIF vs COUNTIFS · SUMIF vs SUMIFS.