1. Sorting Subtotals
If you try to sort a subtotaled dataset while
viewing all the data, Excel informs you that to do so would remove all
the subtotals. Although the data itself cannot be sorted, the subtotal
rows can be, and the data within will remain intact. To do this,
collapse the data so that only the subtotals are being viewed, and then
apply the desired sort.
Sorting a Subtotaled Column
To sort the dataset by a subtotaled column, follow these steps:
1. | Collapse the dataset so only the subtotals are in view.
|
2. | Select a cell in the column to be sorted.
|
3. | Go to Data, Sort & Filter, and select the quick sort button for the desired sort order.
|
2. Grouping and Outlining
Selected rows and groups can be grouped together
manually using the options in Data, Outline, Group. The Expand/Collapse
button will be placed below the last row in the selection or to the
right of the last column in the selection.
If
the data to be grouped includes a calculated total row or column
between the groups, you can use the Auto Outline option. This option
creates groups based on the location of the rows or columns containing
formulas. If the dataset contains formulas in both rows and columns,
though, the option will create groups for both rows and columns. This
tool works best if there are no formulas within the dataset itself,
unless you do want the groups to be created based off those
calculations.
Use the Group option for absolute control of how the
rows or columns are grouped. For example, if you have a catalog with
products grouped together, users can expand or collapse each group to
view the products, as shown in Figure 1.
By default, the Expand/Collapse buttons will appear below the data. To
get them to appear above the grouped data, first apply a subtotal to
the dataset with Summary Below Data unselected. Then undo the change
and apply the desired groupings.
Groups can be cleared one of two ways from the Data, Outline, Ungroup drop-down:
Ungroup— Ungroups the selected data. Will ungroup a single row from a larger group if that is all that is selected.
Clear Outline—
Clears all groups on a sheet unless more than one cell is selected, in
which case the selected item will be ungrouped. If used on data that
was subtotaled using the Subtotal button, the subtotals will remain;
only the groups will be removed.
Manually Grouping Rows
To manually group rows with the Expand/Collapse button above the grouped dataset, follow these steps:
1. | Select a cell in the dataset.
|
2. | Go to Data, Outline, Subtotal.
|
3. | A message may appear that Excel cannot determine which row has column labels. Click OK.
|
4. | In the Subtotal dialog, deselect Summary Below Data and click OK.
|
5. | Click the Undo button in the Quick Access toolbar.
|
6. | Select the first set of rows to group together. Do not include the header. For example, to create the Hitachi grouping in Figure 1, select rows 4 and 5 to group. To create the Haier group, select only row 2.
|
7. | Go to Data, Outline, Group, Group, or just select the Group button itself.
|
8. | Repeat steps 6 and 7 for each group of rows. |