Counts rows where every one of several conditions is true at once.
COUNTIFS is COUNTIF with room for more than one condition. How many orders were in the North region and above 20 units; how many tickets were opened this month and are still unresolved. Each condition narrows the count further, and every one must hold for a row to be counted.
Unlike the SUMIF/SUMIFS pair, there is no argument-order trap here: COUNTIFS takes range-and-criteria pairs from the start, exactly as COUNTIF does, because there is no separate range to count — it counts the rows themselves.
It is also the natural way to count between two values. Give it the same range twice with opposite comparisons, and you have a band: at least this, at most that. The same trick with a date column gives you a date range.
=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], …)criteria_range1criteria1criteria_range2, criteria2, …Headers in row 1, data in A2:D6. Note the blank in C4 and the text in C6.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Item | Units | Unit price | Region |
| 2 | Cordless drill | 12 | 89.99 | North |
| 3 | Extension lead | 40 | 12.5 | South |
| 4 | Safety goggles | 8 | North | |
| 5 | Work gloves | 25 | 5.4 | South |
| 6 | Tool belt | 6 | n/a | North |
=COUNTIFS(D2:D6, "North")Result: 3
One condition, written as COUNTIFS. Identical to the COUNTIF equivalent.
=COUNTIFS(D2:D6, "North", B2:B6, ">10")Result: 1
Two conditions. Only the drill row is both North and above ten units.
=COUNTIFS(B2:B6, ">=10", B2:B6, "<=30")Result: 2
The same range twice for a band: between 10 and 30 inclusive, which catches 12 and 25.
=COUNTIFS(D2:D6, "South", B2:B6, ">100")Result: 0
A legitimate zero — nothing satisfies both. Worth distinguishing from the accidental zeros below.
Reading about a formula is not the same as writing one. Open this function's exercise and type it into a real grid — you get instant feedback on exactly which cell is wrong and why.
Why it happens: One criterion does not match the stored data: trailing spaces, numbers stored as text, or a comparison operator written without quotes.
How to fix it: Remove conditions one at a time. The one that brings the count back from 0 is the broken one.
Why it happens: The criteria ranges are different sizes.
How to fix it: Make every range span the same rows. Whole-column references guarantee it.
Why it happens: Writing ">F1" searches for the literal text ">F1" rather than comparing to F1.
How to fix it: Join the operator to the reference: ">"&F1.
Why it happens: * and ? act as wildcards, so a criterion containing them matches more than intended.
How to fix it: Escape them with a tilde: "~*" matches a literal asterisk.
Use the same range twice with opposite operators: =COUNTIFS(B2:B100, ">=10", B2:B100, "<=30"). Both conditions apply to every row, so only values inside the band are counted.
Not within one call — every criteria pair narrows with AND. Add two COUNTIFS together for OR, and subtract a third counting the overlap if a row could satisfy both.
Dates need the operator joined to the value with &, and the value needs to be a real date rather than text: ">="&DATE(2024,1,1) or ">="&F1 where F1 holds a date. Typing ">=01/01/2024" inside quotes compares against a string.
Longer reads where this function does real work in a real sheet.