Counting function
Excel COUNTIFS function
COUNTIFS counts rows where every condition you give is true. You supply pairs of a range and a condition. Use it for questions like "how many West orders over $500" or "how many items low on stock in one warehouse".
=COUNTIFS(criteria_range1, criteria1, ...)Arguments
criteria_range1- The first range to check.
criteria1- The condition for that range, like "West" or ">500".
COUNTIFS examples
Every result below was calculated live from this sample sheet.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | SKU | Warehouse | Category | Qty |
| 2 | HX-100 | Dallas | Tools | 42 |
| 3 | HX-101 | Dallas | Paint | 8 |
| 4 | HX-102 | Denver | Tools | 5 |
| 5 | HX-103 | Denver | Paint | 61 |
| 6 | HX-104 | Dallas | Tools | 3 |
| 7 | HX-105 | Denver | Tools | 27 |
Result: 2
Tools lines stocked in Dallas. Both conditions must match.
Result: 1
Items in Denver with fewer than 10 on hand.
Result: 2
Use the same range twice to count between two numbers.
Result: #VALUE!
Ranges of different sizes return #VALUE!. Every range must have the same shape.
How to use COUNTIFS
- Click an empty cell.
- Type =COUNTIFS( and select the first range.
- Type a comma and its condition in quotes.
- Add more range, condition pairs as needed.
- Close the bracket and press Enter.
Common COUNTIFS mistakes
Ranges of different sizes
Every criteria range must have the same number of rows and columns, or Excel returns #VALUE!.
Expecting OR logic
COUNTIFS only counts rows where all conditions are true. For "Dallas OR Denver", add two COUNTIFS together.
Dates typed as text
Write date conditions as ">="&DATE(2025,1,1) so Excel compares real dates.
COUNTIFS FAQ
What is the difference between COUNTIF and COUNTIFS?
COUNTIF takes one condition. COUNTIFS takes one or more pairs of range and condition, and counts rows where all of them are true.
How do I count between two dates in Excel?
Use =COUNTIFS(A2:A100,">="&DATE(2025,1,1),A2:A100,"<="&DATE(2025,3,31)).
How do I use COUNTIFS with OR in Excel?
Add two COUNTIFS: =COUNTIFS(B:B,"Dallas")+COUNTIFS(B:B,"Denver"). Or use =SUM(COUNTIFS(B:B,{"Dallas","Denver"})).
Practice COUNTIFS in these lessons
Guides that use COUNTIFS
- How to find duplicates in Excel
- How to use COUNTIF greater than in Excel
- Excel IF statement with multiple conditions
- COUNTIFS with multiple criteria in Excel
- Excel formulas cheat sheet: the 25 everyone should know
Related functions
COUNTIFCounts cells that matchSUMIFSAdds with several conditionsAVERAGEIFSAverages with several conditionsFILTERKeeps matching rows, spills
Updated 2026-10-31