Imagine you’re working with a product list or customer order sheet in Excel.
Some items say Available, some say Out of Stock, some say Pending, and a few cells are completely blank.
Now you want to know something very specific, like:
- How many products are marked as Available?
- How many orders have more than 100 units?
- How many entries say Pending?
You don’t want to count everything.
you only want to count the cells that meet one condition.
Doing this manually?
Scroll… scroll… scroll…
“Did I count this one already?”
“Nope… starting again…”
This is where the COUNTIF function makes life so much easier.
In simple words:
COUNTIF = counts cells that match ONE specific condition.
Whether it’s numbers greater than 100, text like “Completed”, or dates after a certain day — COUNTIF can handle it.
What Is the COUNTIF Function?
The COUNTIF function in Excel counts how many cells meet one condition.
It works with:
- numbers
- text
- dates
- symbols
- comparisons (`>`, `<`, `>=`, `<>`)
- partial matches (`”abc”`)
COUNTIF is perfect when you want to filter your data using one rule.
Syntax:
=COUNTIF(range, criteria)
Arguments:
- range: The cells you want to check
- criteria: The condition the cells must match
You can use:
- a number
- text
- a cell value
- a comparison
- a wildcard pattern
Examples:
Here’s a full product/order table to make the examples real:
| Order ID | Customer Name | Product | Quantity | Status | Amount | Region |
| 101 | John | Laptop | 2 | Delivered | 1200 | North |
| 102 | Sara | Mouse | 1 | Pending | 20 | South |
| 103 | Rakesh | Keyboard | 3 | Delivered | 90 | East |
| 104 | Meera | Laptop | 1 | Cancelled | 600 | West |
| 105 | David | Monitor | 2 | Delivered | 300 | North |
| 106 | Ali | Mouse | 5 | Pending | 100 | East |
| 107 | Anita | Laptop | 1 | Delivered | 600 | South |
| 108 | Chris | Keyboard | 4 | Delivered | 120 | North |
| 109 | Priya | Laptop | 3 | Pending | 1800 | West |
| 110 | Mohan | Mouse | 2 | Delivered | 40 | East |
1. Count Orders Marked as Pending:
=COUNTIF(E2:E11, “Pending”)

Result → 3 (Orders 102, 106, 109)
2. Count Quantities Greater Than 2:
=COUNTIF(D2:D11, “>2”)

Counts values greater than 2
Result → 4 (quantities: 3, 3, 4, 5)
3. Count Exact Matches (e.g., Quantity = 1):
=COUNTIF(D2:D11, 1)

Result → 3 (orders with quantity 1)
4. Count Blank Cells Using COUNTIF:
Even though COUNTBLANK exists, COUNTIF can do it:
=COUNTIF(A1:A10, “”)

Counts empty cells.
Result: 0
5. Count Cells NOT Equal to Something:
=COUNTIF(E2:E11, “<>Pending”)

Counts all statuses except “Pending”.
Result: 7
6. Count Text That Contains a Word (Exact Match):
For example, count all products contains “Laptop”:
=COUNTIF(C2:C11, “Laptop”)

Result → 4 (all “Laptop” entries)
7. Count Dates Before or After a Specific Day:
Example: count dates after 01-01-2024:
=COUNTIF(A2:A11, “>01-01-2024”)
When Should You Use COUNTIF?
Use COUNTIF when you want to count only the values that match one condition.
Perfect for:
- counting orders above a target
- counting “Completed” tasks
- counting students who passed (>40)
- counting sales greater than a certain value
- counting customers from a specific region
- counting feedback containing keywords
- counting products with a specific status
COUNTIF helps you filter and analyze data quickly, without complex formulas.
Related Functions (Quick Guide):
| Function | What It Does |
| COUNT | Counts numbers only |
| COUNTA | Counts non-empty cells |
| COUNTBLANK | Counts empty cells |
| COUNTIF | Counts with one condition |
| COUNTIFS | Counts with multiple conditions |
In Simple Words:
COUNTIF = count only what you need
Works with one condition (like `>100`, `”Done”`, `”Laptop”`)
Perfect for filtering, analyzing, and summarizing real data.
COUNTIF makes Excel smarter — and your work much faster.
Discover more from Excellopedia
Subscribe to get the latest posts sent to your email.