How to use COUNTIF and COUNTIFS in Excel
COUNTIF counts the cells that meet a condition: how many orders a rep made, how many invoices are over a limit. COUNTIFS counts rows that meet several conditions at once.
Syntax
=COUNTIF(range, criteria)
=COUNTIFS(range1, criteria1, range2, criteria2, ...)
range- The cells to check.
criteria- The condition, in quotes for text and comparisons:
"Ashley",">1000".
Try it now · free, no sign-up
Count orders
- In G2, count how many orders Ashley made.
- In G3, count the orders over $1,000.
- In G4, count orders that are in the East and for a Laptop.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Rep | Region | Product | Amount | Question | Count | |
| 2 | Ashley | West | Laptop | 1,200.00 | Ashley's orders | ||
| 3 | Brian | East | Monitor | 300.00 | Orders over $1,000 | ||
| 4 | Ashley | East | Laptop | 1,150.00 | East laptops | ||
| 5 | Daniel | South | Keyboard | 80.00 | |||
| 6 | Brian | West | Laptop | 1,300.00 | |||
| 7 | Daniel | East | Monitor | 320.00 | |||
| 8 | Ashley | West | Keyboard | 75.00 | |||
| 9 | Brian | South | Laptop | 1,250.00 |
Loading the live spreadsheet…
Common conditions
"<>" counts cells that are not empty; "" counts empty ones. "*north*" counts cells containing "north" anywhere. ">="&F2 compares with the value in F2.
COUNT, COUNTA and COUNTIF
COUNT counts numbers, COUNTA counts anything that is not empty, and COUNTIF counts what matches a condition. Interview tests often mix these up on purpose.
Common mistakes
- Comparison without quotes
=COUNTIF(D2:D9,>1000)is an error. Write">1000".- Counting with OR
- COUNTIFS joins conditions with AND. For "East or West", add two COUNTIFs together.
Practice it until it sticks
ExcelFluent has 42 hands-on lessons, from SUM to XLOOKUP, plus 5 real work projects and a final challenge that uses everything. Every answer is checked instantly. The first 5 lessons and 1 work project (an invoice with tax) are free.
Start the free lessons → Open the full COUNTIF & COUNTIFS lessonFrequently asked questions
Is COUNTIF case sensitive?
No. "ashley" and "Ashley" are counted the same.
How do I count unique values?
In Microsoft 365, =COUNTA(UNIQUE(A2:A9)).