Excel tutorial
/

Functions

Intermediate

Excel SUBTOTAL: totals that include only visible rows in a filtered table

SUBTOTAL skips rows hidden by a filter: sum, average, count, MAX/MIN in one function. The 9 vs 109 difference, nested subtotals and common traps.

You filtered the sales table down to Tashkent, yet =СУММ(C2:C7) at the bottom still shows the total of the whole table. SUM adds hidden rows too — it doesn’t “see” the filter.

SUBTOTAL solves exactly this: it only counts visible rows. Change the filter and the total changes with it.

On top of that, one function covers 11 operations (sum, average, count, MAX, MIN…) and never re-adds the results of other SUBTOTALs — ideal for reports with subtotals.

Книга1 - Excel
—☐✕
C8fx=ПРОМЕЖУТОЧНЫЕ.ИТОГИ(9;C2:C7)
ABCD
1BranchManagerSales (m)
2TashkentAziz120
3SamarkandDilnoza85
4TashkentJavohir140
5BukharaMalika60
6SamarkandSardor95
7TashkentNodira110
8Total610
9
Готово
No filter applied yet — SUBTOTAL(9,…) returns 610, just like SUM. The difference shows once the filter is on (below)

Syntax

=ПРОМЕЖУТОЧНЫЕ.ИТОГИ(function_num; ref1; [ref2]; ...)

  • function_num — which operation to perform (a code). The most common: 9 — SUM, 1 — AVERAGE, 2 — COUNT, 3 — COUNTA, 4 — MAX, 5 — MIN.
  • ref1, ref2, … — the ranges to calculate.

Each code comes in two flavours:

  • 1–11 — skip rows hidden by a filter but include rows hidden manually (Hide).
  • 101–111 — skip both: only what you can see on screen.
Книга1 - Excel
—☐✕
B8fx9
ABCD
1OperationCode 1–11Code 101–111
2AVERAGE1101
3COUNT2102
4COUNTA3103
5MAX4104
6MIN5105
7STDEV.S7107
8SUM9109
9
Готово
The main codes. Full list: 6 — PRODUCT, 8 — STDEV.P, 10 — VAR.S, 11 — VAR.P. Excel shows the list of codes as you type the formula

Filter + SUBTOTAL step by step

1

Select any cell in the table and click Данные → Фильтр (Ctrl + Shift + L). Arrows appear in the headers.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Получить данныеОбновить все
Получить данные
СортировкаФильтр
Сортировка и фильтр
Текст по столбцамУдалить дубликатыПроверка данных
Работа с данными
A2fxTashkent
ABCD
1BranchManagerSales (m)
2TashkentAziz120
3SamarkandDilnoza85
4TashkentJavohir140
5
Готово

2

Click the Branch arrow and keep only Tashkent.

Книга1 - Excel
—☐✕
A1fxBranch
ABCD
1BranchСортировка от А до ЯСортировка от Я до А(Выделить все)BukharaSamarkandTashkentManagerSales (m)
2TashkentAziz120
3SamarkandDilnoza85
4TashkentJavohir140
5
Готово

3

Select the cell below the table and click Автосумма (Alt + =). With a filter on, Excel itself writes =ПРОМЕЖУТОЧНЫЕ.ИТОГИ(9;C2:C7) instead of SUM. The result is the sum of visible rows only.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить
Буфер обмена
Calibri ▾11 ▾
Шрифт
Выравнивание
Общий ▾
Число
Условное форматированиеФорматировать как таблицуСтили ячеек
Стили
ВставитьУдалитьФормат
Ячейки
АвтосуммаСортировка и фильтрНайти и выделить
Редактирование
C5fx370
ABCD
1BranchManagerSales (m)
2TashkentAziz120
3TashkentJavohir140
4TashkentNodira110
5SUBTOTAL(9)370
6SUM610
7
Готово
Filter: Tashkent only (Samarkand and Bukhara rows are hidden). SUBTOTAL shows 370, while SUM adds the hidden rows and shows 610
Книга1 - Excel
—☐✕
E3fx=ПРОМЕЖУТОЧНЫЕ.ИТОГИ(1;B2:B7)
ABCDEF
1BranchSales (m)MeasureValue
2Tashkent120Sum (9)610
3Samarkand85Average (1)101,7
4Tashkent140Count (2)6
5Bukhara60Max (4)140
6Samarkand95Min (5)60
7Tashkent110
8
Готово
Example 1: one range — five measures. Only the code changes. Apply a filter and all five recalculate on visible rows only
Книга1 - Excel
—☐✕
C4fx=ПРОМЕЖУТОЧНЫЕ.ИТОГИ(9;C2:C3)
ABCD
1BranchManagerSales (m)
2TashkentAziz120
3TashkentJavohir140
4Tashkent total260
5SamarkandDilnoza85
6SamarkandSardor95
7Samarkand total180
8Grand total440
9
Готово
Example 2: C8 holds =ПРОМЕЖУТОЧНЫЕ.ИТОГИ(9;C2:C7) — 440. The subtotals (260 and 180) aren’t added again. SUM would give 880 — every sale counted twice

Pro level: numbering, AGGREGATE and the table total row

  • 1, 2, 3… even after filtering: type =ПРОМЕЖУТОЧНЫЕ.ИТОГИ(3;$B$2:B2) in A2 and fill down. After filtering, visible rows renumber from 1.
  • “Showing 3 of 6”: =ПРОМЕЖУТОЧНЫЕ.ИТОГИ(3;A2:A7)&" of "&СЧЁТЗ(A2:A7) — show the filter state in the report header.
  • AGGREGATE is the stronger sibling: it can skip errors too. =AGGREGATE(9;7;C2:C100) sums without hidden rows and without errors like #N/A. It has 19 operations, including MEDIAN (12), LARGE (14) and SMALL (15).
  • Table total row: format the data as a Table and turn on Table Design → Total Row — Excel puts SUBTOTAL(109,…) there for you.
  • <<tab:Data>> → Subtotal adds SUBTOTAL rows for every group of a sorted list and builds outline buttons (1, 2, 3) on the left.

Try it in the simulator

Type =ПРОМЕЖУТОЧНЫЕ.ИТОГИ(9;C2:C7) in C8 and =ПРОМЕЖУТОЧНЫЕ.ИТОГИ(1;C2:C7) in C9. Then change C3 to 200 — both results update. Note: the simulator’s SUBTOTAL doesn’t distinguish hidden rows — try the filter difference in real Excel.

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1BranchManagerSales (m)
2TashkentAziz120
3SamarkandDilnoza85
4TashkentJavohir140
5BukharaMalika60
6SamarkandSardor95
7TashkentNodira110
8Total
9Average
10
11
12
13
Лист1
Готово

Has ExcelLab been useful?

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

Support us
Previous

132 / 154