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.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Sum of Amount | Column Labels | ||||
| 2 | Row Labels | Bukhara | Samarkand | Tashkent | Grand Total | |
| 3 | Qtr1 | 12 000 000 | 25 500 000 | 37 500 000 | ||
| 4 | Qtr2 | 17 000 000 | 6 400 000 | 23 400 000 | ||
| 5 | Qtr3 | 8 500 000 | 9 600 000 | 18 100 000 | ||
| 6 | Qtr4 | 9 600 000 | 9 600 000 | |||
| 7 | Grand Total | 26 600 000 | 20 500 000 | 41 500 000 | 88 600 000 | |
| 8 |
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.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Sum of Amount | ||
| 2 | 15.01.2025 | 25 500 000 | ||
| 3 | 20.02.2025 | 12 000 000 | ||
| 4 | 10.04.2025 | 6 400 000 | ||
| 5 | 05.05.2025 | 17 000 000 | ||
| 6 | 18.07.2025 | 8 500 000 | ||
| 7 | 22.08.2025 | 9 600 000 | ||
| 8 | 12.11.2025 | 9 600 000 | ||
| 9 | Grand Total | 88 600 000 | ||
| 10 |
2
Right-click any date and choose Group....
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Sum of Amount | ||
| 2 | 15.01.2025 | 25 500 000 | ||
| 3 | 20.02.2025 | 12 000 000 | ||
| 4 | 10.04.2025 | 6 400 000 | ||
| 5 | 05.05.2025 | 17 000 000 | ||
| 6 | 18.07.2025 | 8 500 000 | ||
| 7 | 22.08.2025 | 9 600 000 | ||
| 8 | 12.11.2025 | 9 600 000 | ||
| 9 | Grand Total | 88 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.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Sum of Amount | ||
| 2 | 15.01.2025 | 25 500 000 | ||
| 3 | 20.02.2025 | 12 000 000 | ||
| 4 | 10.04.2025 | 6 400 000 | ||
| 5 | 05.05.2025 | 17 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.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Count of Amount | ||
| 2 | 6 400 000 | 1 | ||
| 3 | 8 500 000 | 1 | ||
| 4 | 9 600 000 | 2 | ||
| 5 | 12 000 000 | 1 | ||
| 6 | 17 000 000 | 1 | ||
| 7 | 25 500 000 | 1 | ||
| 8 | Grand Total | 7 | ||
| 9 |
3
Click OK. Now it’s obvious: most sales are under 10 million, and only one is above 20 million.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Count of Amount | ||
| 2 | 0-9999999 | 4 | ||
| 3 | 10000000-19999999 | 2 | ||
| 4 | 20000000-29999999 | 1 | ||
| 5 | Grand Total | 7 | ||
| 6 |
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:
- Select the Bukhara and Samarkand cells with Ctrl.
- Right-click → Group... — “Group1” appears, and a new Region2 field shows up in the pane.
- Type Regions into the “Group1” cell and press Enter.
The PivotTable becomes two-level: the group on top, the regions inside it.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Sum of Amount | ||
| 2 | Regions | 47 100 000 | ||
| 3 | Bukhara | 26 600 000 | ||
| 4 | Samarkand | 20 500 000 | ||
| 5 | Tashkent | 41 500 000 | ||
| 6 | Tashkent | 41 500 000 | ||
| 7 | Grand Total | 88 600 000 | ||
| 8 |
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.
| 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 | Amount | From | To | Sales | ||||||||||||||||||||
| 2 | 25500000 | 0 | 10000000 | |||||||||||||||||||||
| 3 | 12000000 | 10000000 | 20000000 | |||||||||||||||||||||
| 4 | 6400000 | 20000000 | 30000000 | |||||||||||||||||||||
| 5 | 17000000 | |||||||||||||||||||||||
| 6 | 8500000 | |||||||||||||||||||||||
| 7 | 9600000 | |||||||||||||||||||||||
| 8 | 9600000 | |||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||
| 11 | ||||||||||||||||||||||||
| 12 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.