Back to functions
Statistical2026-03-183 related articles

COUNTIF Function in Excel

Count the number of cells in a range that meet a single condition.

Syntax

COUNTIF(range, criteria)

Arguments

range

Required

The range of cells to evaluate.

criteria

Required

The condition that determines which cells to count. Can be a number, text, expression, or cell reference.

What it returns

Returns the number of cells in the range that match the criteria.

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.

Related functions

Related articles

Deep dives, troubleshooting guides, and practical examples that use COUNTIF.

Official documentation