Excel functions / Maths & statistics
COUNTIF
Counts the cells that meet one condition.
Syntax
=COUNTIF(range, criteria)Arguments
range | The cells to check. |
|---|---|
criteria | The condition, such as "Yes", ">=50" or "*tea". |
How it works
COUNTIF answers "how many?" questions: how many orders from the East, how many scores of 50 or more, how many cells say Yes.
Text conditions are not case-sensitive, and you can use wildcards for partial matches.
Example
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Region | Rep | Sales | ||
| 2 | East | Ana | 500 | 2 | |
| 3 | West | Ben | 300 | ||
| 4 | East | Cal | 250 | ||
| 5 | West | Dee | 700 | ||
| 6 |
Result: 2. Two rows are in the West.
Tips
- Put comparisons in quotes: ">=50", not >=50.
Practise COUNTIF
Try it yourself in a real spreadsheet, with instant feedback on every answer.