Sub topic 9
Ungrouping and Changing a Grouping
This chapter assumes you can build a PivotTable, place fields in Rows, Columns, and Values, and use Sum and Count. You should also know how to open the Grouping dialog for dates, numbers, and text items. Here you will learn how to remove a grouping, change one, and avoid the common mistakes.
How a grouping is stored
A grouping belongs to the PivotTable, not to the source data. When you group a field, Excel keeps the grouping rules inside the PivotTable's cache. The source cells do not change. Because of this, you can undo or redo a grouping without touching your data.
Dates and numbers share one dialog, with fields such as Starting at, Ending at, and By. Text items use manual groups instead, and those create new group fields. This difference affects how you remove each kind.
Ungrouping a field
To remove a date or number grouping:
- Click any cell in the grouped field, for example a month label in Rows.
- Go to PivotTable Analyze and choose Ungroup. You can also right-click the cell and choose Ungroup.
The field returns to its original items, such as individual dates or raw numbers. If you grouped dates by Years, Quarters, and Months, one Ungroup command removes all of those units at once.
For manually grouped text, select a group name and choose Ungroup. This removes that group's structure. The field then shows the original items again.
Changing an existing grouping
You do not have to ungroup before you change a grouping. Select a cell in the grouped field and choose Group Field (or Group Selection for text). The Grouping dialog opens with the current settings. Adjust them and click OK.
Common changes:
- Add or remove a unit. Click a unit such as Quarters to turn it on or off.
- Change the numeric bucket size. Edit the By value, for example from 10 to 25.
- Move the weekly start date. Edit Starting at so the seven-day periods begin on a different day.
The table shows which command suits each task.
| Goal | Command | Effect |
|---|---|---|
| Remove all grouping from a date or number field | Ungroup | Field shows raw items again |
| Change units, start, end, or step | Group Field | Dialog opens with current settings |
| Rename a text group | Edit the group label | Only the label changes |
| Dissolve a text group | Ungroup on the group name | Group structure is removed |
Renaming and reading group labels
Date and number groups get automatic labels, such as Qtr1 or 10-19. You can type over a label in the PivotTable to rename it. Text groups start with names like Group1, and you should rename these too, because the default names say nothing about their contents.
Renaming is cosmetic. It does not change the underlying rule. If you change the grouping settings later, a typed label may be replaced by a generated one.
The grouping workflow
The diagram shows the decisions you make when a grouping is not what you want.
Common errors
- Ungroup is greyed out. You may have selected a cell outside the grouped field, such as a value cell or the PivotTable's blank area. Click a label inside the grouped field and try again.
- Only part of the field changed. For text groups, Ungroup acts on the selected group. Select each group in turn, or select the field heading, to remove them all.
- A field name appears twice. After you manually group text, Excel adds a new field such as
Region2. Remove it from the PivotTable layout if you only want the original field. - A date grouping returns after you drag the field. In newer Excel versions, automatic date grouping can add units again when you place a date field in Rows. Ungroup after placing the field, or turn off automatic grouping in the options.
Practice
Exercise
A PivotTable groups an Order Date field by Years, Quarters, and Months. You want to see individual dates again. What is the fastest way to do this, and what happens to the three units?
Show answer
Click any cell in the grouped date field and choose Ungroup (PivotTable Analyze, or the right-click menu). One Ungroup command removes all three units at once, and the field shows the individual dates again.
Exercise
A numeric Price field is grouped with By set to 10. You want buckets of 25 instead. Do you need to ungroup first?
Show answer
No. Select a cell in the field, choose Group Field, change By from 10 to 25, and click OK. The dialog opens with the current settings, so the change replaces the old step.