Sub topic 2
Automatic Date Grouping and Other PivotTable Groups
Assume you can create a PivotTable and place fields in Rows, Columns, and Values. You should also know basic Excel formulas and how source data is stored.
Automatic Date Grouping
In newer Excel versions, adding a date field to a PivotTable can create separate fields for Years, Quarters, Months, and Days. This is automatic date grouping. It lets you summarize dates without opening the Grouping dialog.
To disable this feature, open File > Options > Data and clear Automatically group date/time columns in PivotTables. The exact wording can vary by Excel version. Existing grouped fields may still need PivotTable Analyze > Ungroup.
Grouping Numbers into Ranges
Place a numeric field, such as order value, in Rows. Select a number in the PivotTable, then choose PivotTable Analyze > Group Selection. Set:
- Starting at: the first boundary
- Ending at: the last boundary
- By: the interval width
For example, Starting at 0, Ending at 100, and By 10 creates ranges such as 0–9, 10–19, and 20–29. Text, blanks, or errors in the source field can prevent grouping.
Grouping by Days and Weeks
To create seven-day periods, select a date item and choose Group Selection. Select Days, enter 7 for Number of days, and choose the desired Starting at date. The result uses seven-day intervals from that start date. It may not match calendar weeks unless you start on the correct weekday.
For a stable Monday-based week, add a helper column to the source table:
=A2-WEEKDAY(A2,2)+1This returns the Monday for the week containing the date in A2. Refresh the PivotTable and use this helper field instead.
Manually Grouping Text Items
Text items cannot be grouped by equal-width rules. Instead, Ctrl-click the items you want, choose PivotTable Analyze > Group Selection, and replace the generated group name with a meaningful label such as North region. Repeat for other sets of items.
Exercise
A PivotTable creates Months and Years automatically, but you need the original date field. What should you do?
Show answer
Disable automatic date grouping for future PivotTables, then select the existing grouped field and choose PivotTable Analyze > Ungroup.