What COUNTIF does
COUNTIF counts how many cells in a range match a condition. It works with numbers, text, dates, and expressions like greater-than or less-than.
For multiple conditions, use COUNTIFS instead.
Practical examples
Count cells that match a value
=COUNTIF(B2:B100,"Pass")
Counts every cell in column B that contains the text "Pass".
Count cells above a threshold
=COUNTIF(C2:C100,">"&70)
Counts cells with values greater than 70. The & operator joins the comparison operator with the number.
Count non-blank cells matching a pattern
=COUNTIF(A2:A100,"*report*")
Counts cells containing the word "report" anywhere in the text. The asterisk is a wildcard.
Common mistakes and notes
Text criteria need quotes
Criteria like "Pass" or ">70" must be wrapped in double quotes, even when they contain numbers.
COUNTIF is case-insensitive
"pass", "Pass", and "PASS" are all treated the same. For case-sensitive counting, use SUMPRODUCT with EXACT.
One condition only
COUNTIF accepts a single condition. For two or more conditions, use COUNTIFS.