Imagine a booking list with more than 70 rows, in which each row comes from a different company. For the printout you may only need the invoice number, company and gross price, and the VAT or the booking date just get in the way. This is exactly where the grouping and outlining functions in Excel help you. You show and hide rows and columns, stack several levels on top of each other and even have totals calculated automatically per company. In this tutorial you will learn all the steps, from simple column grouping to analysis with subtotals.
Key Takeaways
- With grouping, you show and hide rows and columns with a click, without deleting any data.
- You can nest groupings within each other and quickly switch between overview and details using the level buttons 1, 2 and 3.
- The "Subtotal" function automatically creates groups and totals, for example for each company.
- Before creating the subtotals, the table must be sorted by the grouping criterion, otherwise the outline will not work correctly.
Step-by-Step Guide
Step 1: Select the columns for grouping
Open your booking list in Excel. For the example you only need the columns invoice number, company and gross price. The columns date, purpose, net amount and VAT should disappear temporarily. To do this, select the four columns you want to hide by clicking on the column letter and selecting the adjacent columns while holding down the mouse button. Make sure that the selection includes only the columns that should later be in the group.

Step 2: Find the outline function in the "Data" menu
Now switch to the "Data" tab in the menu bar at the top. On the far right in the "Outline" group you will find the "Group" button. With it you specify that the selected columns are combined into a group. Excel then displays a small line with a minus sign above the column letters.

Step 3: Define the grouping across rows and columns
When you select the grouping, a bracket appears above the columns. If you hover the mouse over this bracket, you can immediately see which columns are affected. With the small arrow pointing down you can have the grouping created automatically. Excel then recognizes the structure of your table and forms the group by itself. If the grouping doesn't quite fit, you can simply repeat the process and adjust the selection.

Step 4: Show and hide grouped columns with one click
Once the group is set up, a minus sign appears above the columns. A click on it hides the group, and the sign turns into a plus sign. With another click on the plus sign you display the columns again. This way you can switch between the print view and the complete table at any time without deleting anything.

Step 5: Group rows
The principle works exactly the same way with rows. If you select, for example, all bookings of a certain company, such as "abcore", you again choose the "Group" option in the "Data" menu under "Outline". You can then hide and show these rows again using the minus sign at the left edge. This is handy if you only want to view part of your list.

Step 6: Nest multiple groupings
You can also nest groupings within each other. Suppose you first group columns C to G and then columns D to E. This creates a second outline level. If you click the minus sign of the inner group, only columns D and E disappear, while the remaining columns stay visible. It is important that you arrange the groups sensibly so that the hierarchy remains logical for you.

Step 7: Quickly switch the overview with the level buttons
Above the table, at the left edge, Excel displays the buttons 1, 2 and 3. These levels are especially handy when you have created many groups. A click on button 1 shows only the top level, for example the grand total. Button 2 shows the next level, and button 3 finally displays all details. This way you get an overview of large tables in a few seconds.

Step 8: Ungrouping groups
If you no longer need an outline, you can remove it. To do so, go to "Data", then "Outline" and select "Ungroup". You can decide whether you want to remove the row grouping or the column grouping. If you select the entire sheet, all groupings can be removed at once. If you want to remove the entire outline, additionally select "Clear Outline" in the menu. Afterwards, your table is back in its original view.


Step 9: Sorting the table correctly before the subtotal
Before you use the automatic outline with subtotals, you must sort the table. This is the most important step of all. If, for example, you need an analysis by company, you sort the data via "Data", "Sort & Filter" by the "Company" column from A to Z. Sorting by invoice number would mean that Excel cannot group the companies together.

Step 10: Calling up the subtotal
Once the table is sorted, you go to "Data" again and select the "Subtotal" button under "Outline". A dialog window opens in which you define the settings for the analysis.

Step 11: Defining the grouping criterion and totals
In the dialog window, you first select the column to group by under "At each change in", in this example "Company". Then you determine the type of calculation under "Use function", usually "Sum". Next, under "Add subtotal to", you check the columns that should be summed, such as net amount and gross price. You can optionally also insert a page break between the groups, but this plays no role for the analysis.

Step 12: Generating the result with "OK"
Confirm your settings by clicking "OK". Excel now creates a separate group for each company, inserts a row with the subtotal and calculates the grand total at the end. You will then see, for example, how much you spent last year on the garage, fuel, rent or your mobile phone.

Step 13: Switching between totals and details with the outline levels
The results can be controlled using the level buttons. If you click on level 2, all companies are displayed with their subtotals, while the individual entries remain hidden. At level 1, you only see the grand total. At level 3, all individual entries appear again. In this way, you can summarize or deepen your analysis as needed.

Summary ??? Grouping and outlining in Excel: How to keep an overview with subtotals
With the grouping function in Excel, you decide for yourself which rows and columns you see. You select the relevant areas, group them via the "Data" menu and show or hide them with a click. Multiple groupings can be nested within one another, and the level buttons 1, 2 and 3 give you an overview in seconds. The subtotal is well suited for analyses, with which Excel automatically summarizes companies or other categories and calculates totals. Remember to sort the table beforehand by the right criterion, then the outline will work reliably.
FAQ
Do I have to sort the table before grouping?This is only strictly necessary for subtotals, because Excel only summarizes entries with the same value that are directly below one another. For simply showing and hiding rows or columns, no sorting is required.
Can I undo a grouping?Yes, via "Data", "Outline" and "Ungroup" you remove individual groups. With "Clear Outline" you remove all groupings of a sheet at once.
Is data lost when grouping?No, grouping only hides rows or columns. The contents remain fully preserved and can be shown again at any time.
How many grouping levels can I create?You can nest several levels. The level buttons at the left or top edge then show you the available levels.
Why is my subtotal not calculated correctly?This is often due to missing sorting by the grouping criterion. Therefore, first sort the table by the column, for example "Company", and then create the subtotal again.
