Excel tutorial
/

Functions

Intermediate

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.

Книга1 - Excel
—☐✕
F2fx=СЧЁТЕСЛИМН(A2:A8;"Tashkent";B2:B8;"Delivered")
ABCDEFG
1CityStatusAmountQuestionAnswer
2TashkentDelivered1 250 000Tashkent + delivered3
3SamarkandCancelled640 000
4TashkentCancelled2 100 000
5BukharaDelivered480 000
6TashkentDelivered910 000
7SamarkandDelivered1 730 000
8TashkentDelivered350 000
9
Готово
There are 4 orders from Tashkent, but one was cancelled — 3 meet both conditions

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.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить функциюАвтосуммаФинансовыеЛогическиеТекстовыеДата и времяСсылки и массивыМатематические
Библиотека функций
Диспетчер имён
Определённые имена
F2fx
ABCDEFG
1CityStatusAmountQuestionAnswer
2TashkentDelivered1 250 000Tashkent + delivered
3SamarkandCancelled640 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.

Книга1 - Excel
—☐✕
F2fx
ABCDEFG
1CityStatusAmountQuestionAnswer
2TashkentDelivered1 250 000Tashkent + delivered
3SamarkandCancelled640 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")

Книга1 - Excel
—☐✕
F3fx=СЧЁТЕСЛИМН(A2:A8;"Tashkent";B2:B8;"Delivered";C2:C8;">=1000000")
ABCDEFG
1CityStatusAmountQuestionAnswer
2TashkentDelivered1 250 000500k to 1.5 mln3
3SamarkandCancelled640 000Tashkent + delivered + 1 mln+1
4TashkentCancelled2 100 000
5BukharaDelivered480 000
6TashkentDelivered910 000
7SamarkandDelivered1 730 000
8TashkentDelivered350 000
9
Готово
3 orders fall in the range. Only one (1,250,000) meets all three conditions

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.

Книга1 - Excel
—☐✕
F4fx=СЧЁТЕСЛИМН(A2:A7;">="&F1;A2:A7;"<="&КОНМЕСЯЦА(F1;0);B2:B7;F2)
ABCDEFG
1DateManagerAmountMonth01.01.20251
203.01.2025Aziz820 000ManagerAziz
314.01.2025Dilnoza1 430 000Sales this month4
426.01.2025Aziz560 000Of them, manager’s2
529.01.2025Dilnoza990 000
604.02.2025Aziz1 200 000
712.02.2025Dilnoza700 000
8
Готово
1 — type 01.02.2025 in F1 and the results recalculate for February

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). $D2 locks the column (the city always comes from D), E$1 locks 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;"<>").
Книга1 - Excel
—☐✕
F3fx=СЧЁТЕСЛИМН($A$2:$A$8;$D3;$B$2:$B$8;F$1)
ABCDEFG
1CityStatusCityDeliveredCancelled
2TashkentDeliveredTashkent31
3SamarkandCancelledSamarkand11
4TashkentCancelledBukhara10
5BukharaDelivered
6TashkentDelivered
7SamarkandDelivered
8TashkentDelivered
9
ГотовоСреднее: 1,1667Количество: 6Сумма: 7
The single formula from E2 is filled across E2:F4 — the $ signs pick the city and status from the right place

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").

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1CityStatusAmountQuestionAnswer
2TashkentDelivered1250000Tashkent + delivered
3SamarkandCancelled640000500k to 1.5 mln
4TashkentCancelled2100000
5BukharaDelivered480000
6TashkentDelivered910000
7SamarkandDelivered1730000
8TashkentDelivered350000
9
10
11
12
Лист1
Готово

Has ExcelLab been useful?

Support the project and help us release new lessons and exercises.

Support us
Previous

87 / 154