Excel tutorial
/

PivotTables

Advanced

Grouping in a PivotTable: dates by month and quarter, numbers into ranges

Group PivotTable dates by month, quarter and year, amounts into ranges, combine items by hand, and fix the “Cannot group that selection” error.

Every sale in the source is recorded with its own date. Put Date into PivotTable rows and a year of data can produce 365 rows — nobody will read that report. Your manager wants a simple answer: “Which quarter was best?”

Grouping combines PivotTable items into bigger blocks: dates into months, quarters and years, numbers into ranges (0–10 million, 10–20 million), and text items into groups of your choice. Not a single helper column is added to the source.

Книга1 - Excel
—☐✕
E3fx37500000
ABCDEF
1Sum of AmountColumn Labels
2Row LabelsBukharaSamarkandTashkentGrand Total
3Qtr112 000 00025 500 00037 500 000
4Qtr217 000 0006 400 00023 400 000
5Qtr38 500 0009 600 00018 100 000
6Qtr49 600 0009 600 000
7Grand Total26 600 00020 500 00041 500 00088 600 000
8
Готово
7 dates grouped into 4 quarters: the strongest is Q1 (37.5 million)

Grouping dates by quarter and month

1

Put the Date field in Rows. Excel 2016 and Microsoft 365 often group dates automatically (Years and Quarters fields appear in the pane). If every date shows up as its own row, group them manually.

Книга1 - Excel
—☐✕
A2fx45672
ABCD
1Row LabelsSum of Amount
215.01.202525 500 000
320.02.202512 000 000
410.04.20256 400 000
505.05.202517 000 000
618.07.20258 500 000
722.08.20259 600 000
812.11.20259 600 000
9Grand Total88 600 000
10
Готово
Ungrouped: every date is a separate row

2

Right-click any date and choose Group....

Книга1 - Excel
—☐✕
A2fx45672
ABCD
1Row LabelsSum of Amount
215.01.2025КопироватьФормат ячеек...ОбновитьСортировкаФильтрПромежуточные итогиРазвернуть/свернутьГруппировать...Разгруппировать...MoveПараметры поля...Параметры сводной таблицы...Показать список полей25 500 000
320.02.202512 000 000
410.04.20256 400 000
505.05.202517 000 000
618.07.20258 500 000
722.08.20259 600 000
812.11.20259 600 000
9Grand Total88 600 000
10
Готово

3

In the Grouping dialog, Starting at and Ending at hold the first and last dates (Excel fills them in). In the By list click Quarters; click Months (selected by default) to deselect it if you don’t need it. If the data spans several years, always select Years too.

Книга1 - Excel
—☐✕
A2fx45672
ABCD
1Row LabelsSum of Amount
215.01.202525 500 000
320.02.202512 000 000
410.04.20256 400 000
505.05.202517 000 000
6
Готово

4

Click OK — the dates merge into quarters. Move Region to Columns and you get the result above. To undo: right-click → Ungroup....

Splitting numbers into ranges

1

Put the Amount field in Rows and once more in Values, then switch the Values copy to Count. For now every amount is its own row.

2

Right-click any number in Rows → Group.... Starting at: 0, Ending at: 30000000, By: 10000000 — ranges in steps of 10 million.

Книга1 - Excel
—☐✕
A2fx6400000
ABCD
1Row LabelsCount of Amount
26 400 0001
38 500 0001
49 600 0002
512 000 0001
617 000 0001
725 500 0001
8Grand Total7
9
Готово

3

Click OK. Now it’s obvious: most sales are under 10 million, and only one is above 20 million.

Книга1 - Excel
—☐✕
B2fx4
ABCD
1Row LabelsCount of Amount
20-99999994
310000000-199999992
420000000-299999991
5Grand Total7
6
Готово
Number of sales per amount range — a frequency table in a second

Grouping text items by hand

Besides dates and numbers you can combine any items yourself. For example, put Bukhara and Samarkand into a “Regions” group and leave Tashkent on its own:

  1. Select the Bukhara and Samarkand cells with Ctrl.
  2. Right-click → Group... — “Group1” appears, and a new Region2 field shows up in the pane.
  3. Type Regions into the “Group1” cell and press Enter.

The PivotTable becomes two-level: the group on top, the regions inside it.

Книга1 - Excel
—☐✕
A2fxRegions
ABCD
1Row LabelsSum of Amount
2Regions47 100 000
3Bukhara26 600 000
4Samarkand20 500 000
5Tashkent41 500 000
6Tashkent41 500 000
7Grand Total88 600 000
8
Готово
Bold rows are the groups (Region2), the regions sit underneath

Pro level: weeks, turning off auto-grouping, fiscal years

  • By week. In the Grouping dialog select only Days, set Number of days to 7 and put a Monday in Starting at (for example 13.01.2025). Each group runs Monday to Sunday.
  • Turn off automatic grouping. If dates keep splitting into years and quarters on their own: File → Options → Data → Disable automatic grouping of Date/Time columns in PivotTables (Microsoft 365).
  • Fiscal year or custom periods. If your company’s quarter starts in April, the standard Quarters won’t fit. Add a period column to the source with a formula and use it in the PivotTable — it adapts to any logic.
  • Data Model PivotTables don’t support manual grouping — use a helper column or DAX there as well.

Try it in the simulator

Recreate the range counts with a formula: type =СЧЁТЕСЛИМН($A$2:$A$8;">="&C2;$A$2:$A$8;"<"&D2) in E2 and fill it down to E4. The result matches the PivotTable: 4, 2, 1.

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1AmountFromToSales
225500000010000000
3120000001000000020000000
464000002000000030000000
517000000
68500000
79600000
89600000
9
10
11
12
Лист1
Готово

Has ExcelLab been useful?

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

Support us
Previous

64 / 154