← All comparisons

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

COUNTIFSUMIF
What it returnsA count of matching cellsThe sum of values in matching rows
Columns involvedOne (the range you test)Two (the range you test + the range you add)
Argument orderrange, criteriarange, criteria, [sum_range] — sum_range LAST (opposite of SUMIFS)
Same-column shortcutN/AOmit sum_range to sum the tested column itself: =SUMIF(A:A,">100")
Multi-condition siblingCOUNTIFSSUMIFS (sum_range moves to FIRST)
CompatibilityUniversalUniversal — identical in every version of all three apps we test

Which should you use?

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.