Excel COUNTIF Function
COUNTIF counts the cells in a range that meet one condition.
Use it for one-condition counts, such as how many orders are complete, how many scores are above a threshold, or how many names match a pattern.
COUNTIF syntax & arguments
Syntax
=COUNTIF(range, criteria)
-
1
range
RequiredThe cells to test against the criterion.
-
2
criteria
RequiredThe condition that decides which cells are counted. It can be a number, text, cell reference, expression such as
">=80", or wildcard pattern.
Example
=COUNTIF(B2:B50, "Complete")
Count how many cells in B2:B50 contain Complete.
COUNTIF caveats
COUNTIF is compact, but most mistakes come from criteria syntax and trying to stretch it beyond one condition.
-
Operators usually need quotes
Criteria such as
">=80"or"<>Complete"must be written as text. -
It only handles one condition
Use COUNTIFS instead when you need to count rows that satisfy multiple criteria at the same time.
-
Wildcards have special meaning
*matches any text and?matches one character. Use~before a wildcard when you need the literal character. -
The range is both tested and counted
COUNTIF cannot test one range and count a different range. For that pattern, use COUNTIFS or helper logic.
Need a conditional sum? Use SUMIF when matching cells should drive values that are added instead of counted.
Intro COUNTIF practice problem
Solve the intro problem directly here, or open it on its own page.
Advanced COUNTIF practice problems
Use COUNTIF alongside other Excel functions in realistic, less-prescriptive challenges.