What you will learn
- Count the cells that match
- Write what to look for: words, numbers or comparisons
How it works
COUNTIF(range, criteria) counts the cells that match.
- Words:
"West" - Comparisons, in quotes:
">500" - Or a cell name, like
F2
Capital letters don't matter. "west" matches "West".
Formulas at a glance
=COUNTIF(B2:B9,"West") | equals |
=COUNTIF(C2:C9,">500") | comparison |
Example
Write the formula to count how many orders came from the West.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Order | Region | Amount | Status | Question | Answer | |
| 2 | 1001 | West | 820 | Shipped | West orders | ||
| 3 | 1002 | East | 240 | Pending | Orders over 500 | ||
| 4 | 1003 | North | 510 | Shipped | Shipped orders | ||
| 5 | 1004 | West | 130 | Shipped | Pending orders | ||
| 6 | 1005 | South | 975 | Pending | Orders under 300 | ||
| 7 | 1006 | East | 660 | Shipped | |||
| 8 | 1007 | West | 390 | Pending |
Click G2 and type =COUNTIF(B2:B9,"West"), then press Enter.
The answer is 3.
When to use it
- How many orders came from one region
- How many scores are over 80
- How many tasks say "Done"
Common mistakes
- Leaving out the quotesWords and signs go in quotes: "West", ">500".
- Putting a space inside the quotes"West " with a space doesn’t match "West".
- Using COUNTIF for two conditionsUse COUNTIFS when there is more than one condition.
Quick check
Which formula counts cells in A1:A20 that are more than 50?
=COUNTIF(A1:A20,>50)=COUNTIF(A1:A20,">50")=COUNT(A1:A20>50)=COUNTIF(">50",A1:A20)
Show the answer
B. =COUNTIF(A1:A20,">50") Comparisons go inside quotes.
Practice it on a real sheet
Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.