WHAT DOES COUNTIF DO
The COUNTIF
function counts how many cells in a range match a single condition. It’s useful for quick summaries like how many sales are above a threshold or how many orders came from a region.
If you need multiple conditions, use COUNTIFS.
WHEN TO USE IT
- You want to count how many cells match one condition
- Your data is arranged in columns (e.g. Region, Product, Quantity)
- You want a simple filter without extra steps or helper columns
FORMULA SYNTAX
COUNTIF(range, criteria)
Argument | Description |
---|---|
range | The group of cells to check |
criteria | The condition to apply, like "West" or ">100" |
EXAMPLE 1: COUNT ORDERS FROM THE WEST REGION
We want to count how many orders came from the West.
A | B | |
---|---|---|
1 | Region | Product |
2 | West | A |
3 | East | B |
4 | West | A |
5 | West | B |
=COUNTIF(A2:A5, "West")
Result: 3 (rows 2, 4, and 5)
EXAMPLE 2: COUNT ORDERS GREATER THAN $100
We want to count how many orders are greater than $100.
A | B | |
---|---|---|
1 | Customer | Amount |
2 | Alice | 120 |
3 | Bob | 90 |
4 | Carol | 180 |
5 | David | 60 |
=COUNTIF(B2:B5, ">100")
Result: 2 (rows 2 and 4)
COMMON PITFALLS AND EDGE CASES
- Text and logical operators must be in quotes — e.g.
">100"
,"West"
- Use
"<>"
to count non-blank or “not equal” values - Wildcards are supported:
"*"
for any characters,"?"
for one character - Only one condition allowed — use COUNTIFS if you need more
FURTHER READING
Official Microsoft documentation:
COUNTIF – Microsoft Support