The COUNTIF function counts how many cells in a range match a single condition. This guide explains how COUNTIF works and includes practical examples you can use immediately.
WHAT THE COUNTIF FUNCTION DOES
COUNTIF tallies cells that meet one specific criterion, such as counting how many sales are above a threshold, how many orders came from a specific region, or how many entries match a text pattern. It's useful for quick data summaries without needing helper columns.
If you need multiple conditions, use COUNTIFS.
WHEN TO USE COUNTIF
Use COUNTIF when you want to:
- Count how many cells match one condition
- Get quick summaries of your data
- Filter and count 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)
Need help applying this? Try this in Numstro Builder
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)
Need help applying this? Try this in Numstro Builder
COMMON MISTAKES & 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
RELATED FUNCTIONS
FURTHER READING
Official Microsoft documentation:
COUNTIF — Microsoft Support