Excel Guide
How to Use COUNTIFS in Excel: Count Rows That Match Two or More Conditions
=COUNTIFS(criteria_range1, criteria1, criteria_range2, criteria2, ...). COUNTIFS counts only the rows where every condition is true at the same time. It is the function for questions like "how many West orders were over $100?" — one condition is COUNTIF's job, two or more is COUNTIFS'. Practise it: COUNTIFS — 10 Excel practice problems.
COUNTIF first: one condition
COUNTIF takes a range and one condition, and counts the cells that match it:
Worked through on PractiseSkills' COUNTIF topic page, that formula over West, East, West, North, West, East returns 3 — the three rows that say "West". A comparison works the same way:
Over scores of 95, 82, 91, 78, 90, 88, that returns 3 — the scores 95, 91 and 90. Note the comparison operator goes inside the quotes: ">=90", not >=90 on its own.
COUNTIF stops being enough the moment the question has an "and" in it: not just West orders, but West orders over $100. That is COUNTIFS.
COUNTIFS: pairs of range + criteria
COUNTIFS takes pairs — a range, then the condition for that range — and you can add as many pairs as the question needs:
Read it left to right: "in A1:A4, find 'West'; in B1:B4, find values over 100; count the rows where both are true." Worked through on PractiseSkills' COUNTIFS topic page:
Row 1 counts (West, 120). Row 2 fails (East). Row 3 fails (80 is not over 100). Row 4 counts (West, 150). Result: 2.
The same pattern works with two text conditions, two numbers, or a mix. Counting "Sales" employees rated 4 or higher:
That returns 2 on the topic page's example (Sales 5, Sales 3, Support 4, Sales 4). And a numeric condition paired with a text flag — products in stock and on sale:
That also returns 2 (stock 5/yes, 0/yes, 10/no, 3/yes). The rule the topic page states each time: every criteria pair must match on the same row.
The three mistakes that break COUNTIFS
1. Treating it as OR. COUNTIFS is AND only — a row counts only if all conditions hold. There is no OR mode. To count rows matching either of two conditions, add two COUNTIFs together instead:
2. Forgetting the quotes around a comparison. ">100", ">=4" and "<20" are text criteria — the operator and the number go inside the quotes together. Writing >100 bare, or ">100" without the closing quote, gives an error or a wrong count.
3. Ranges of different sizes. Every range in a COUNTIFS must cover the same number of rows. =COUNTIFS(A1:A10, "West", B1:B4, ">100") returns a #VALUE! error because the ranges do not line up. Keep the ranges the same height and the same starting row, and the count will be right.
COUNTIFS and SUMIFS are a pair
COUNTIFS counts the matching rows; SUMIFS adds up a value across those same rows. The shape is identical — pairs of range and criteria — except SUMIFS takes the range to sum first:
So once you can write a COUNTIFS, you can write a SUMIFS: same conditions, different answer. PractiseSkills covers the summing side on its SUMIFS topic page.
Practise it
The COUNTIFS topic page has 10 exercises that build up step by step — counting orders from a region above a value, employees in a department with high ratings, products in stock and on sale, students passing in a specific class, and more. Three are free with worked solutions and no sign-up needed; the rest are graded on the formula you write in the live spreadsheet. Start with COUNTIF if the single-condition version is not solid yet, and browse the full list of 75 topics on the practice hub.
Try it yourself
Practice COUNTIF and COUNTIFS with real interactive exercises and instant feedback.
Start practicing COUNTIFS →