Group dates into months and numbers into bands
PivotTables8 minPremium
Builds on Rearrange a PivotTable with Rows, Columns and Filters.
A heating repair company in Minneapolis logs every service call with its date and amount. The owner wants this winter's revenue by month beside last winter's, and the dispatcher wants to know how many calls were small jobs.
How it works
Grouping gathers a field's items into bigger groups, so daily dates become months and single amounts become bands. Right-click a date or an amount in the PivotTable and choose Group.
- For dates, the Grouping dialog lists Seconds, Minutes, Hours, Days, Months, Quarters and Years, and you can pick several. Quarters and Years then appear as fields of their own in the field list, so you can drag Years to Columns and set the years side by side.
- For numbers, fill in Starting at, Ending at and By. Starting at 0 with By 100 makes bands of 0-99, 100-199 and so on. Excel suggests the smallest and largest values as the start and end, so type round numbers over them.
Months alone puts every January in one group, whatever its year. When the dates cover more than a year, select Years too. To go back to single dates or amounts, right-click the field and choose Ungroup.
Example
The owner groups two winters of service calls by Months, then by Years and Months.
Common mistakes
- Months without Years on dates that cross a year. January of both years adds up in one row, and nothing on the report says so.
- Bands that start at the smallest amount. Excel's suggested start gives bands such as 37-136 and 137-236. Type 0, or another round number, in Starting at.
- A date column with a blank or a date typed as text. Excel stops with "Cannot group that selection." Fix the cell in the list, then refresh.
In short
- Right-click a date or a number in the PivotTable and choose Group.
- Group dates by months, quarters or years, and add Years whenever the dates cross a year.
- Group numbers into bands with Starting at, Ending at and By.
Practice
Premium4 PivotTables.
Practice is part of Premium
Every lesson is free to read, and you can practice the free lessons without an account. This lesson's exercises are part of Premium, which you add to a free account.
Have one? Sign in