How to Collapse Outline in Excel
In this article
Yes, you can collapse an outline in Excel to hide detailed rows or columns, which is useful for focusing on summary data. First, you must ensure your data is structured with clear headers and that the outline levels are automatically recognized by Excel's grouping feature; if the outline symbols are missing, you must create the groups manually before collapsing them.
What You'll Need
- A computer with Microsoft Excel installed (the steps apply to Excel on Windows and Mac).
- A dataset with at least two levels of data—such as a main category and sub-items—to demonstrate the collapsing effect.
Step-by-Step
- Prepare your data structure: Organize your data so that the summary data is at the top (or left) and the detailed data is immediately below (or to the right). Ensure you have a clear header row for each level of data. For example, if you are tracking sales by region and then by city, the region totals should be above the city lists.
- Check for existing outlines: Look at the top-right corner of your window, just above the row numbers and column letters. Do you see small buttons with a minus sign (-) and a plus sign (+)? These are the outline symbols. If they are missing, you cannot collapse the outline yet. Click inside any cell of your data range, go to the Data tab on the ribbon, and look for the Group command in the Outline section. Select Group (and then Rows or Columns as needed) to create the outline manually.
- Select the rows or columns to collapse: To collapse a specific section, click on the row numbers or column letters of the rows or columns you want to hide. For instance, to hide the rows containing city-level sales data while keeping the region totals visible, click the row numbers of the city rows. To collapse all sub-levels at once, you can click the level number button in the outline symbols area (e.g., the "2" button if your outline has three levels).
- Use the outline buttons to collapse: With the rows or columns selected, look at the outline symbols in the grouping area. Click the minus (-) button to collapse the selected rows or columns, hiding the details and replacing them with a single row or column containing the summary. The minus sign will change to a plus (+), indicating that this section can be expanded again. Clicking the plus sign will expand the collapsed section back to its full detail.
- Navigate collapsed outlines: When an outline is collapsed, you can still navigate through the data. Click on the plus (+) button next to a collapsed section to expand it temporarily to view a specific row, then click the minus (-) to collapse it again. This allows you to peek at individual details without permanently expanding the entire section.
- Adjust outline levels: Excel allows you to control the level of detail shown using the level buttons (1, 2, 3, etc.) in the outline symbols area. Clicking "1" will collapse all levels, showing only the highest-level summary data. Clicking "2" will show the first and second levels, collapsing any deeper levels. Choose the level that best suits your current viewing needs.
- Print or save with collapsed outlines: When you print your worksheet or save it, Excel retains the current state of the outlines. If you have collapsed an outline before printing, the printed output will show only the visible rows or columns. You can also save the workbook with specific outlines collapsed for future reference or to share a clean summary view with others.
Common Mistakes
Mixing up row and column grouping: When creating a manual outline, it is crucial to specify whether you are grouping rows or columns. If you select a range of rows and then try to group columns, Excel will likely group the entire dataset incorrectly or throw an error. Always ensure your selection matches the direction you want to collapse.
Trying to collapse without grouping: A common error is attempting to collapse data that has never been grouped. The collapse buttons will not appear or function if Excel does not recognize the data as part of an outline. You must first create the group using the Data > Group command before you can use the collapse feature.
Accidentally collapsing the wrong level: If your data has multiple levels of grouping, clicking a button on the outline symbols area will collapse that entire level across the entire sheet. For example, clicking the "2" level button will collapse all second-level groups, not just the one you are currently looking at. This can make the sheet look empty if you aren't expecting it. Always double-check which level you are collapsing.
Tips
Use keyboard shortcuts for speed: Once you have created an outline, you can use keyboard shortcuts to collapse and expand groups more quickly. Pressing Alt + Shift + - (minus) on Windows or Cmd + Shift + - on Mac will collapse the selected group. Pressing Alt + Shift + + (plus) or Cmd + Shift + + will expand the selected group. This is much faster than clicking the mouse buttons.
Customize outline symbols: If you find the outline symbols distracting, you can turn them off. Go to the File tab, select Options, choose Advanced on the left, and scroll down to the Display section. Uncheck the box for Show outline symbols if an outline is applied. Note that doing this will also hide the grouping buttons in the Data tab, so you will need to recreate any groups manually if you want to use them again in the future.
Check for merged cells: Merged cells can often confuse Excel's auto-outline feature. If you see that the outline symbols are missing or that the grouping is not working as expected, check your data for merged cells. Merging cells across the outline hierarchy can prevent Excel from correctly identifying the boundaries of the groups. Try unmerging the cells and restructuring the data to see if the outline then appears.
Troubleshooting
Outline symbols are missing: If you cannot find the minus and plus buttons at the top of your window, your data has not been grouped. Go to the Data tab and click the Group command. Select the rows or columns you wish to group and ensure you select the correct radio button (Rows or Columns). If your data is not contiguous or has blank rows, Excel may prompt you to create an outline manually by selecting non-contiguous ranges.
Error message when grouping: If you receive an error when trying to create a group, it is usually because Excel cannot distinguish between summary data and detail data. Ensure that your summary data is above or to the left of the detail data and that there are no blank rows or columns separating the levels. Merged cells are also a common cause; try removing any merged cells in the selection range.
Groups are not collapsing correctly: If clicking the collapse button does not hide the rows or columns you expect, check which rows or columns are actually selected. The collapse function only affects the currently selected range. If you have multiple groups selected, it will collapse all of them simultaneously. Select only the specific group you want to collapse before clicking the button.
Outlines are not printing: If you have collapsed an outline but the printed output still shows the detailed rows or columns, ensure that you have not accidentally clicked the Expand All button in the Data tab. This button expands all groups and overrides the current view state. You can also try clearing the print area and redefining it after collapsing the outlines to ensure the printer sees the correct view.
Frequently Asked Questions
Can I collapse outline levels in Excel Online?
Yes, the outline feature is supported in Excel Online. You can click the row or column headers to select the groups and then use the minus and plus buttons in the top-right corner to collapse and expand them, just like in the desktop version.
How do I create an outline from scratch if Excel won't do it automatically?
Select the rows or columns you want to group, go to the Data tab, and click Group. If Excel asks you to confirm, select the appropriate option (Rows or Columns). You can repeat this process for multiple levels of hierarchy to build a manual outline.
What is the difference between hiding rows and collapsing an outline?
Hiding rows manually (using the Right-click > Hide option) does not create an outline. This means you cannot use the collapse buttons, and the row numbers will still appear, but with a thin line indicating they are hidden. Collapsing an outline is a structural feature that allows you to expand and collapse groups dynamically and is often required for features like subtotals.
Can I collapse columns instead of rows?
Absolutely. The process is identical to collapsing rows, except you click on the column letters instead of the row numbers. You then use the outline buttons to collapse or expand those specific columns of data.
Why does my outline look messy or uneven?
This usually happens when there are merged cells or blank rows/columns within the data range. Excel tries to draw lines based on the data structure, but merged cells create gaps that break the outline lines. Unmerging cells and removing blank spaces usually fixes the visual appearance.
Can I save a view with collapsed outlines?
Yes, when you save your workbook, Excel saves the current state of the outlines. If you have collapsed a section and then save the file, that collapsed state will be loaded the next time you open the file. You can also create a new workbook and copy the collapsed view into it to share a clean summary with a colleague.