Excel function reference

COUNTIF

Quick answer

Counts how many cells in a range meet one condition.

COUNTIF(range, criteria)

COUNTIF answers a headcount question: how many scores are above 90, how many orders are still Pending, how many entries match a given status. It never totals anything; for that, SUMIF covers the same single-condition shape but adds up a value instead of counting rows.

The one syntax detail worth internalizing early: an operator written out as text, like >90, has to be wrapped in quotes so Excel can parse the operator out of the string. A plain equality match, like a number or an exact piece of text, works with or without the quotes.

Syntax

COUNTIF(range, criteria)
ArgumentDescription
rangeRequired. The cells to evaluate, e.g. B2:B20.
criteriaRequired. A number, text, or comparison as text, like 90, "Pass", or ">90".

A real example: counting orders still awaiting shipment

A status column with free-text entries, counted for an exact match:

=COUNTIF(B2:B20,"Pending")

Because COUNTIF's text matching is case-insensitive, this catches "pending", "Pending", and "PENDING" all the same way, which is usually what's wanted for a status column someone has been typing into by hand.

Worked examples

Counting above a threshold
AB
1StudentScore
2Lin95
3Ari82
4Sam91
=COUNTIF(B2:B4,">90") → 2
Counting an exact text match
AB
1OrderStatus
21001Shipped
31002Pending
41003Shipped
=COUNTIF(B2:B4,"Shipped") → 2

Common mistakes

  • Forgetting the quotes around a comparison like ">90". Without them Excel can't parse the operator.
  • Using COUNTIF when the real ask is a total, not a headcount. That's SUMIF instead.
  • Case sensitivity confusion: COUNTIF's text matching is actually case-insensitive, so "shipped" and "Shipped" count the same.

Related functions

Try it yourself

A free, graded practice exercise using this exact function: instant feedback, no signup required.

Practice COUNTIF →