Grouping Data in PivotTables: Dates, Numbers & Custom Groups

Grouping data in Excel PivotTables tutorial showing date number and category grouping for analysis and reporting
Make large datasets easier to understand by grouping data in Excel PivotTables. This practical tutorial shows you how to group dates into months, quarters, and years, group numbers into useful ranges, and organize related items into custom categories. Learn how PivotTable grouping can simplify complex datasets, reveal trends, improve reporting, and make dashboards easier to analyse. Ideal for Excel users, analysts, accountants, auditors, finance professionals, and anyone who works with PivotTables and large datasets.

A PivotTable is only as clear as its rows. Feed it a year of daily dates, and you get 365 cramped lines. Feed it raw ages, and every single value becomes its own row. That detail hides the very pattern you want to see. Grouping solves this. It rolls fine detail into clean buckets, so months, ranges, and custom sets appear instead of noise.

This guide shows how to group any field the right way. First, it explains the three kinds of grouping. Then it walks through dates, numbers, and custom text sets. Real examples and a full troubleshooting section follow. By the end, you will tame even the messiest field in a click or two.

What Grouping Does

Grouping bundles many values into fewer buckets. It works on three kinds of fields. Dates roll into months, quarters, or years. Numbers fall into equal ranges, and text items join custom sets. The infographic below shows all three.

Three kinds of grouping roll detail into useful buckets DATES 365 daily rows 12 months / 4 quarters roll up by period NUMBERS hundreds of ages 0-17, 18-25, 26-40 ... bins of equal size TEXT many small regions custom groups you pick e.g. North vs South

The payoff is a report you can actually read. Instead of hundreds of rows, you see a handful. Moreover, the totals stay exact, since nothing is deleted. As a result, trends jump straight off the page.

Group Dates Into Periods

Dates are the most common thing to group. You can roll them into months, quarters, and years. Better still, you can pick several levels at once. Then Excel builds a neat drill-down hierarchy, as shown below.

Date grouping builds a drill-down hierarchy YEAR (2024) QUARTER (Q1 - Q4) MONTH (Jan - Dec) DAY (raw dates)
Group a date field: 1. Right-click any date inside the PivotTable. 2. Choose Group. 3. Select Months, Quarters, and Years together. 4. Click OK. Excel adds Quarters and Years as new fields. So you can expand a year down to a single month.
Modern Excel groups dates for you. Newer versions auto-group dates the moment you add them. You can turn this off under File, Options, Data. So if you prefer manual control, disable it there.

Group Numbers Into Ranges

Numbers group into equal bands called bins. You set a starting point, an end, and an interval. Then Excel sorts every value into the right band. Consequently, a messy column becomes a clean distribution.

Number grouping turns raw values into equal ranges (bins) Raw ages 14, 19, 22, 27, 34 41, 45, 52, 63, 70 Group: start 0, by 18 Grouped bins 0-17 (1 person) 18-35 (4 people) 36-53 (3 people) 54-71 (2 people) Now you can chart an age distribution
Group a number field: 1. Drag the number field to Rows. 2. Right-click any value, then choose Group. 3. Set Starting at, Ending at, and By (the bin size). 4. Click OK to create the ranges. For ages, try starting at 0 and grouping by 18. So you get tidy bands like 0-17 and 18-35.

Build Custom Text Groups

Text fields do not bin automatically. Instead, you pick the items and group them by hand. This is perfect for combining regions or products. For example, you can merge several states into one sales zone.

Group text items: 1. Hold Ctrl and click the items to combine. 2. Right-click the selection, then choose Group. 3. Excel names it Group1; rename it to something clear. 4. Repeat for the next set of items. Rename Group1 to "North Zone", for instance. Then your report rolls those states into one line.

Ungroup and Regroup Safely

Grouping is never permanent, which is reassuring. You can undo any grouping in a moment. Simply right-click the grouped field and choose Ungroup. After that, the original detail returns untouched.

Reverse or adjust a group: - Ungroup: right-click the group > Ungroup. - Regroup: right-click a value > Group, with new settings. - Rename: click a group label and type a new name. Change a bin size any time by regrouping. So you can experiment without fear of losing data.

Grouping and Shared PivotTables

Here is a subtle point worth knowing. Pivots built from one source can share a cache. Grouping a field then affects every pivot on that cache. Because of this, one change can ripple across a report.

Keep shared pivots predictable: - Same source means a shared cache and shared groups. - Regrouping in one pivot updates the others too. - Need independent groups? Build from a separate source. So decide early whether pivots should move together. That choice saves confusion on a busy dashboard.

Troubleshooting Grouping

All three problems below are the most common. Each has a clear cause and a quick fix.

Excel says "Cannot group that selection"

This error almost always points to messy data. A date or number column may hold blanks or stray text. Even one text entry in a date column breaks grouping. First, go back to the source and scan that column. Then fill any blanks and fix values stored as text. A quick way is to multiply numbers by one, or use Text to Columns for dates. After you refresh the pivot, the Group command works again.

Grouping changed a different report

This surprises many people the first time. Two pivots from the same source share one cache. So a group you set in one appears in the other. First, decide whether that shared behaviour is what you want. If it is, nothing is broken, and the link is by design. However, if you need separate groups, build the second pivot from its own copy of the data. That gives each report an independent cache.

Dates grouped automatically and I did not want it

Newer Excel versions group dates as soon as you add them. That default helps most people, yet it annoys others. To take back control, open File, then Options, then Data. There you can switch off automatic date grouping. After that, dates stay as raw values until you group them yourself. You can still group them manually whenever you choose.

Frequently Asked Questions

  • How do I group dates by month in a PivotTable?+
    Right-click any date in the pivot and choose Group. Then select Months, and add Quarters or Years too. Excel builds a drill-down hierarchy for you. So you can expand a year down to a month.
  • Can I group numbers into ranges?+
    Yes, drag the number field to Rows first. Then right-click a value and choose Group. Set a start, an end, and a bin size. As a result, values fall into equal ranges.
  • Why do I get "Cannot group that selection"?+
    Usually the column holds blanks or text. Even one bad value in a date column blocks grouping. So clean the source and fix any text-formatted dates. Then refresh, and grouping works.
  • How do I stop Excel grouping dates automatically?+
    Open File, then Options, then the Data page. There you can turn off automatic date grouping. After that, dates stay as raw values. You can still group them by hand later.