Row Grouping in Excel: Collapse and Expand Rows

How-to basics · Updated November 21, 2026

To group rows in Excel for Microsoft 365 on Windows, select the row numbers you want to organize, then choose Data > Outline > Group and select Rows if prompted. Excel adds outline controls that let you collapse those rows to a summary or expand them again without deleting or changing the data.

What row grouping does

Row grouping creates a collapsible outline for a contiguous block of worksheet rows. When you collapse a group, Excel hides its detail rows and leaves the remaining rows visible, so a large worksheet can be viewed at a broad or detailed level. Click the plus or minus control beside the row numbers to expand or collapse a group.

Grouping is a display and navigation tool: it does not remove rows, rewrite cell values, or replace formulas. For example, a monthly sales sheet might show a total row for each month while allowing the underlying daily transactions to be tucked away. The total formula still calculates from its referenced cells while the detail is hidden.

Excel presents outline-level buttons, numbered from 1 upward, near the upper-left corner of the outlined area. Clicking a level shows the worksheet at that degree of detail. In a simple one-level outline, level 1 generally shows summary rows and level 2 shows the details as well. With nested groups, additional levels let you reveal progressively more of the structure.

How to group rows step by step

  1. Arrange the worksheet so the rows you want to fold up are next to one another. Decide which rows are details and which rows should remain visible as summaries.
  2. Select the row headers by dragging over their numbers on the left. For example, to group rows 5 through 12, select row numbers 5 to 12. Selecting the full row headers makes it clear that you want a row outline, not a column outline.
  3. On the ribbon, choose Data > Outline > Group. If Excel asks whether to group rows or columns, choose Rows, then confirm.
  4. Use the minus control beside the grouped rows to collapse the detail. Click the plus control to show it again. You can also use the numbered outline buttons to change the level of detail across the sheet.

If you select cells rather than row headers, Excel may infer whether the selection is a row or column group; if it cannot, it displays a choice. Selecting the row numbers avoids ambiguity. The group must represent adjacent rows: separate, non-adjacent blocks need separate groups.

In Excel for Mac, the Data tab also contains the grouping command, though ribbon arrangement can vary by release. The shortcut for grouping is usually Option+Shift+Right Arrow; on Windows it is Alt+Shift+Right Arrow. The corresponding ungroup shortcut is Option+Shift+Left Arrow on Mac and Alt+Shift+Left Arrow on Windows. If a shortcut is intercepted by macOS or behaves differently in a particular keyboard setup, use the ribbon command.

Creating nested groups and useful outlines

Nested groups let you collapse detail in stages. Imagine a report with daily transactions, weekly totals, and monthly totals. You could group the transaction rows within each week, then group the weekly sections within each month. The outline level buttons can then show only monthly summaries, monthly and weekly summaries, or all transaction detail.

For a predictable hierarchy, create the smaller, inner groups first and then group the larger blocks around them. Keep summary rows outside the detail block they summarize. A common layout is a total row after each section, followed by the next section. If the summary row is inside the group, it will disappear when you collapse that group, which may defeat the purpose of the summary.

Excel supports up to eight outline levels. A deeply nested outline can be difficult for other people to navigate, so use only as many levels as the data structure genuinely needs. Give summary rows clear labels such as “Week 1 total” or “Department total”; the outline controls themselves do not explain what the figures mean.

Summary rows, automatic outlines, and subtotals

Excel can place summary rows either above or below the details. The setting is relevant when you create or adjust outlines: open the dialog launcher in the Data > Outline group, then use the Settings options. The Summary rows below detail setting controls whether summary rows are expected below their detail. Match the setting to the layout of your worksheet so the outline controls and levels behave as intended.

If the sheet already has a clear formula-based summary structure, Excel may be able to build an outline automatically. Choose the Group drop-down in Data > Outline, then select Auto Outline. Excel looks for formula relationships in the data to infer detail and summary sections. Check the resulting outline carefully: it relies on the worksheet’s structure and formulas, so it may not match the way a person interprets an irregular report. You can remove an unsuitable outline and create groups manually.

For categorized lists that need calculated subtotal rows as well as collapsible detail, the Subtotal command under Data > Outline can insert subtotals and create an outline. It is useful when a list is sorted by a category, such as department, and you want a subtotal at each change in category. It is different from simply grouping existing rows: Subtotal adds rows and calculations. Review the inserted calculations and the worksheet layout before relying on the result.

Grouping compared with hiding, filtering, and tables

Manual hiding, filtering, and grouping all make some rows disappear from view, but they solve different problems:

  • Grouping is best for a stable hierarchy, such as detail rows under a monthly summary. You choose which contiguous sections can be folded up.
  • Hide rows is a quick way to conceal selected rows, but it does not create outline levels or an obvious expand-and-collapse structure for each section.
  • Filter is designed to show records that meet criteria, such as transactions for one region. The visible rows can change when the criteria or source data changes.
  • Excel tables help manage and analyze tabular data, including sorting and filtering. They do not substitute for outline controls when the aim is to collapse a report’s detail sections.

Grouping does not sort the data or decide which records belong together. If a group is meant to represent a category, sort or arrange the rows appropriately before creating the outline. A filter can be used alongside an outline, but remember that each feature controls visibility differently; clearing a filter does not remove row groups.

Ungrouping rows and removing an outline

To remove a particular group, select its row headers and choose Data > Outline > Ungroup. If Excel asks whether to ungroup rows or columns, choose Rows. For nested structures, select the relevant rows and repeat as needed to remove the grouping levels you no longer want.

To remove all outline controls from the worksheet at once, open the Ungroup drop-down in the Outline group and choose Clear Outline. Clearing an outline removes the grouping structure; it does not delete the worksheet rows or their contents. If you only want to see all details temporarily, expand the groups instead of clearing the outline.

Ungrouping is not the same as unhiding rows. If rows remain hidden after you remove grouping, select the surrounding row headers, right-click, and choose Unhide, or use Home > Format > Hide & Unhide > Unhide Rows. Conversely, if rows are hidden manually, the outline’s plus and minus controls may not be the cause.

Common problems and practical checks

If the Group command is unavailable or an outline does not behave as expected, check the selection and worksheet structure before rebuilding the report. These are common causes:

  • The wrong cells are selected. Select the row headers for the intended contiguous block, then try Data > Outline > Group again.
  • The sheet is protected. Worksheet protection can restrict structural changes. Check the Review tab and whether the sheet must be unprotected by someone with permission.
  • Rows are already grouped or nested. Existing outline levels may explain why a plus/minus control or numbered level appears in a different place than expected. Expand the outline and inspect the boundaries.
  • Summary rows are included in the wrong block. A summary row that collapses with the details will not remain visible as a reference. Adjust the selection or the summary-row setting.
  • The rows were hidden another way. Try expanding the outline, then check for manually hidden rows or an active filter if some records still do not appear.

Before sharing an outlined report, expand it once to confirm that all detail is still present, then collapse it to confirm the intended summary view. Consider adding a note or clear labels if recipients might not notice the outline controls.

Frequently Asked Questions

What is the shortcut to group rows in Excel?
On Windows, select the row headers and press Alt+Shift+Right Arrow. On Mac, the usual shortcut is Option+Shift+Right Arrow. If the shortcut does not work in your setup, use Data > Outline > Group.

How do I collapse all grouped rows?
Click the outline level button that displays the desired summary level, commonly level 1 for a simple outline. You can also click the minus control on individual groups. The exact contents shown at each level depend on how many nested groups the sheet has.

Can I group rows that are not next to each other?
Not as one continuous group. Excel’s outline groups cover adjacent rows. Create separate groups for separate blocks, or consider filtering if the goal is to show records scattered throughout a list that match a condition.

Does grouping rows change formulas or delete data?
No. Grouping hides detail rows from view but leaves their contents in the worksheet. Formulas are not rewritten simply because a group is collapsed. Check formulas separately if you are changing or deleting the underlying rows.

Why can’t I see the plus and minus buttons?
Check that an outline exists and that outline symbols are enabled in Excel’s options. On Windows, open File > Options > Advanced and look under Display options for this worksheet for the outline-symbol setting. Also check whether the rows are merely hidden manually or by a filter.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.