Excel COUNTIFS function: counting with multiple conditions
COUNTIFS counts rows that meet several conditions at once: ranges between two values, dates by month, a cross-tab summary and the “or” condition.
COUNTIFS is the multi-condition version of COUNTIF. It counts rows where all conditions are met at the same time: “How many orders are from Tashkent and delivered?”, “How many sales did Aziz make in January?”, “How many orders are between 500 thousand and 1.5 mln?”.
Each condition is a pair: where to check (a range) and what it must be (a criterion). Add as many pairs as you need. COUNTIFS works with a single condition too — which is why many people use it exclusively.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | City | Status | Amount | Question | Answer | ||
| 2 | Tashkent | Delivered | 1 250 000 | Tashkent + delivered | 3 | ||
| 3 | Samarkand | Cancelled | 640 000 | ||||
| 4 | Tashkent | Cancelled | 2 100 000 | ||||
| 5 | Bukhara | Delivered | 480 000 | ||||
| 6 | Tashkent | Delivered | 910 000 | ||||
| 7 | Samarkand | Delivered | 1 730 000 | ||||
| 8 | Tashkent | Delivered | 350 000 | ||||
| 9 |
Syntax
=СЧЁТЕСЛИМН(criteria_range1; criteria1; [criteria_range2; criteria2]; ...)
- criteria_range1 — the range for the first condition:
A2:A8. - criteria1 — the first condition:
"Tashkent",">=500000",">="&F1,"Ph*". - criteria_range2, criteria2 … — more pairs, up to 127.
Conditions are combined with “and” logic: a row counts only if it meets all of them. All ranges must be the same size. Conditions are written the same way as in COUNTIF.
Step by step: entering COUNTIFS
1
Select F2 for the result.
2
Формулы → Вставить функцию → type COUNTIFS in the search box (category Statistical) and click OK.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | City | Status | Amount | Question | Answer | ||
| 2 | Tashkent | Delivered | 1 250 000 | Tashkent + delivered | |||
| 3 | Samarkand | Cancelled | 640 000 | ||||
| 4 | |||||||
| 5 |
3
Fill in the pairs: Criteria_range1 — A2:A8, Criteria1 — "Tashkent"; Criteria_range2 — B2:B8, Criteria2 — "Delivered". Boxes for the next pair appear on their own.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | City | Status | Amount | Question | Answer | ||
| 2 | Tashkent | Delivered | 1 250 000 | Tashkent + delivered | |||
| 3 | Samarkand | Cancelled | 640 000 | ||||
| 4 | |||||||
| 5 |
4
Click OK. The result is 3. The formula: =СЧЁТЕСЛИМН(A2:A8;"Tashkent";B2:B8;"Delivered").
Example 1: a range between two values, and three conditions
For a between condition, use the same range twice — each time with its own criterion:
=СЧЁТЕСЛИМН(C2:C8;">=500000";C2:C8;"<=1500000")
Adding a condition is easy — one more pair: Tashkent, delivered and 1 mln or more:
=СЧЁТЕСЛИМН(A2:A8;"Tashkent";B2:B8;"Delivered";C2:C8;">=1000000")
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | City | Status | Amount | Question | Answer | ||
| 2 | Tashkent | Delivered | 1 250 000 | 500k to 1.5 mln | 3 | ||
| 3 | Samarkand | Cancelled | 640 000 | Tashkent + delivered + 1 mln+ | 1 | ||
| 4 | Tashkent | Cancelled | 2 100 000 | ||||
| 5 | Bukhara | Delivered | 480 000 | ||||
| 6 | Tashkent | Delivered | 910 000 | ||||
| 7 | Samarkand | Delivered | 1 730 000 | ||||
| 8 | Tashkent | Delivered | 350 000 | ||||
| 9 |
Example 2: counting by month — dates in cells
A date is a number too, so “from the start to the end of the month” is an ordinary range. Put the first day of the month in F1 and let EOMONTH find the last:
=СЧЁТЕСЛИМН(A2:A7;">="&F1;A2:A7;"<="&КОНМЕСЯЦА(F1;0))
Take the manager from a cell as well, and one formula works for any month and any employee.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Date | Manager | Amount | Month | 01.01.20251 | ||
| 2 | 03.01.2025 | Aziz | 820 000 | Manager | Aziz | ||
| 3 | 14.01.2025 | Dilnoza | 1 430 000 | Sales this month | 4 | ||
| 4 | 26.01.2025 | Aziz | 560 000 | Of them, manager’s | 2 | ||
| 5 | 29.01.2025 | Dilnoza | 990 000 | ||||
| 6 | 04.02.2025 | Aziz | 1 200 000 | ||||
| 7 | 12.02.2025 | Dilnoza | 700 000 | ||||
| 8 |
Pro level: a cross-tab and a shortcut for “or”
- One formula — a whole table. Cities in rows, statuses in columns. Write the formula once and fill it across the table:
=СЧЁТЕСЛИМН($A$2:$A$8;$D2;$B$2:$B$8;E$1).$D2locks the column (the city always comes from D),E$1locks the row (the status always comes from row 1). These mixed references give you a mini pivot without a PivotTable. - “Or” with an array.
=СУММ(СЧЁТЕСЛИМН(A2:A8;{"Tashkent";"Samarkand"};B2:B8;"Delivered"))— COUNTIFS runs twice and SUM adds the results. - A “not empty” condition.
"<>"— for example, clients with a phone number filled in:=СЧЁТЕСЛИМН(A2:A8;"Tashkent";D2:D8;"<>").
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | City | Status | City | Delivered | Cancelled | ||
| 2 | Tashkent | Delivered | Tashkent | 3 | 1 | ||
| 3 | Samarkand | Cancelled | Samarkand | 1 | 1 | ||
| 4 | Tashkent | Cancelled | Bukhara | 1 | 0 | ||
| 5 | Bukhara | Delivered | |||||
| 6 | Tashkent | Delivered | |||||
| 7 | Samarkand | Delivered | |||||
| 8 | Tashkent | Delivered | |||||
| 9 |
Try it in the simulator
Type =СЧЁТЕСЛИМН(A2:A8;"Tashkent";B2:B8;"Delivered") in F2. Then in F3 count the orders between 500 thousand and 1.5 mln: =СЧЁТЕСЛИМН(C2:C8;">=500000";C2:C8;"<=1500000").
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | City | Status | Amount | Question | Answer | |||||||||||||||||||
| 2 | Tashkent | Delivered | 1250000 | Tashkent + delivered | ||||||||||||||||||||
| 3 | Samarkand | Cancelled | 640000 | 500k to 1.5 mln | ||||||||||||||||||||
| 4 | Tashkent | Cancelled | 2100000 | |||||||||||||||||||||
| 5 | Bukhara | Delivered | 480000 | |||||||||||||||||||||
| 6 | Tashkent | Delivered | 910000 | |||||||||||||||||||||
| 7 | Samarkand | Delivered | 1730000 | |||||||||||||||||||||
| 8 | Tashkent | Delivered | 350000 | |||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||
| 11 | ||||||||||||||||||||||||
| 12 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.