COUNTIF formula

Counts how many cells in a range meet a single condition — how many rows say "Yes", how many values are over a threshold, how many entries contain a certain word.

Syntax

=COUNTIF(range, criteria)

Criteria can be a number, a piece of text, a comparison like ">=50", or a wildcard pattern using * (any number of characters) or ? (a single character) for partial text matches. Text comparisons in COUNTIF aren't case-sensitive, so "yes" and "Yes" count the same cells.

Examples

=COUNTIF(A2:A100,"Yes")

Counts how many cells in A2:A100 contain the text "Yes".

=COUNTIF(B2:B100,">=50")

Counts how many values in the range are 50 or greater.

=COUNTIF(C2:C100,"*Error*")

Counts cells that contain "Error" anywhere in the text, using wildcards on both sides.

Paste your own COUNTIF formula and get a plain-English explanation, or describe what you need and let FormulaFixer write it for you.

Explain a COUNTIF formula →

More formulas