COUNTIF
Counts how many cells in a range meet one condition.
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
| Argument | Description |
|---|---|
| range | Required. The cells to evaluate, e.g. B2:B20. |
| criteria | Required. 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:
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
| A | B | |
|---|---|---|
| 1 | Student | Score |
| 2 | Lin | 95 |
| 3 | Ari | 82 |
| 4 | Sam | 91 |
| A | B | |
|---|---|---|
| 1 | Order | Status |
| 2 | 1001 | Shipped |
| 3 | 1002 | Pending |
| 4 | 1003 | Shipped |
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 →