Grouping cells using the Subtotal command
Grouping is a useful Excel feature that gives you control over how the information is displayed. You must sort before you can group. In this section, we will learn how to create groups using the Subtotal command.
To create groups with subtotals:
- Select any cell with information in it.
- Click the Subtotal command on the Data tab. The information in your spreadsheet is automatically selected, and the Subtotal dialog box appears.
- Decide how you want things grouped. In this example, we will organize by Category.
- Select a function. In this example, we will leave the SUM function selected.
- Select the column where you want the Subtotal to appear. In this example, Total Cost is selected by default.
- Click OK. The selected cells are organized into groups with subtotals.
To collapse or display the group:
- Click the black minus sign, which is the hide detail icon, to collapse the group.
- Click the black plus sign, which is the show detail icon, to expand the group.
- Use the Show Details and Hide Details commands in the Outline group to collapse and display the group as well.
To ungroup select cells:
- Select the cells you want to remove from the group.
- Click the Ungroup command.
- Select Ungroup from the list. A dialog box will appear.
- Click OK.
To ungroup the entire worksheet:
- Select all cells with grouping.
- Click Clear Outline from the menu.