Excel Nested Group Rows: How to Create and Use Them

How-to basics · Updated November 19, 2026

Yes. In Excel for Microsoft 365 on Windows, you can nest row groups by grouping detail rows first, then grouping a larger range that contains those rows. Select the row numbers and choose Data > Outline > Group; the outline controls let readers expand or collapse detail at several levels without deleting it.

What nested row groups mean

A row group is an outline that hides or shows selected worksheet rows together. A nested group is a smaller group inside a larger one. For example, a report might have daily transactions grouped under each week, with all weeks grouped under a month. A reader can expand the month to see its weeks, then open one week to inspect its transactions.

Groups are a presentation and navigation feature, not a way to rearrange the worksheet’s data. Collapsing a group hides its rows; it does not delete them or replace them with a summary. You can still edit the values in the rows when they are visible, and formulas continue to refer to the same cells. Excel displays outline symbols—level buttons and plus or minus controls—beside the row headings when a worksheet has grouped rows.

Excel allows up to eight outline levels. You do not need to use all eight: two or three well-chosen levels are often easier to understand than a deeply nested outline. Keep summary rows visible at the level where they are useful, and make the labels clear enough that a collapsed report still makes sense.

Prepare the worksheet before grouping

Plan the hierarchy before selecting rows. Each smaller group should represent a meaningful set of adjacent detail rows, and the larger group should contain the smaller groups it is meant to control. Put useful subtotals or labels in separate rows so they can remain visible when detail is collapsed. A consistent layout makes Excel’s outline controls easier to operate and less likely to hide important information.

For example, imagine a quarterly report where rows 4–6 contain transactions for week one, row 7 contains its subtotal, rows 8–10 contain transactions for week two, row 11 contains its subtotal, and row 12 contains the quarter total. The two sets of transaction rows can be grouped separately. A larger group spanning rows 4–11 can then contain both weekly groups and their subtotal rows. With the quarter total below the detail, collapsing the larger group can leave the quarter total visible.

  • Use one row per record in the detail area; avoid blank rows inside a group unless they are intentional.
  • Keep totals and headings in predictable positions, and distinguish them visually from detail.
  • Save a copy before making major structural changes to an important report.

Create nested groups in Excel

On Windows in Excel for Microsoft 365, select entire worksheet rows using the row-number headings at the left. To make a group, select the rows that belong together, then choose Data > Outline > Group. If Excel asks whether to group Rows or Columns, choose Rows. Create the smaller groups before the larger enclosing group; this order makes the intended hierarchy clear.

  1. Select the first detail range by clicking its starting row number and dragging to its ending row number. In the example, select rows 4–6.
  2. Choose Data > Outline > Group. Excel adds an outline bracket and a minus control beside the selected rows.
  3. Repeat for the second detail range, rows 8–10. The two week groups are now separate.
  4. Select the full outer range, rows 4–11, including the weekly subtotal rows, and choose Data > Outline > Group again.
  5. Use the minus and plus controls or outline-level buttons to check that the inner and outer groups expand and collapse as intended.

When Excel automatically groups the wrong rows, use Data > Outline > Ungroup to remove the selected outline, then recreate it with the intended range. Depending on the selection and existing outline, Ungroup may offer Rows or Columns. Avoid selecting unrelated rows when creating a group: Excel works on worksheet rows, so grouping a row hides its cells across all columns, not just the columns that contain the report.

Choose where summary rows appear

Excel’s outline setting controls whether it expects summary rows below or above detail rows. The usual arrangement is detail first and subtotal afterward, as in rows 4–6 followed by a subtotal in row 7. This is commonly the default. If your worksheet puts a subtotal above its detail, adjust the setting before grouping so the outline controls preserve the intended summary row.

To review the setting in Windows Excel, open the Data tab and use the dialog box launcher in the Outline group to open Outline Settings. The Summary rows below detail option determines which side Excel treats as the summary side. Clear it if your summary rows are above the detail. The related setting for summary columns applies when you group columns instead of rows. Check the result after changing the setting, especially when the worksheet already has groups.

The setting does not create subtotal formulas or move data. It affects how Excel interprets the placement of summaries in an outline. If totals are not in a consistent position, it may be clearer to reorganize the report first rather than rely on a mixture of summary rows above and below detail.

Expand, collapse, and inspect outline levels

After grouping, Excel shows numbered outline-level buttons near the upper-left of the worksheet and plus or minus controls beside grouped rows. Clicking a minus sign collapses that group; clicking the plus sign expands it. The numbered buttons display different levels of detail. In a two-level outline, a higher-level button shows a more summarized view, while a lower-level button reveals more rows. The exact rows displayed depend on the summary-row setting and the groups you created.

Use the controls to test the report from the reader’s perspective. Collapse the outer group and confirm that the main total or headline remains available. Expand it, then collapse one inner group and check that the other inner groups remain open. This distinction is the practical benefit of nesting: readers can summarize a whole section or inspect one small part without changing the rest of the outline.

If you cannot see the outline symbols, check whether they are hidden in Excel’s display settings. In Windows, open File > Options > Advanced and look under Display options for this worksheet for the option to show outline symbols if an outline is applied. Also check that the worksheet is not so narrow that the controls are difficult to notice. If a workbook opens with groups collapsed, the underlying rows are still there; expand the outline to view them.

Use Auto Outline carefully

Excel can sometimes infer an outline from a worksheet’s formula and summary structure. On Windows, choose Data > Outline > Group > Auto Outline. The command is most useful when detail and subtotal rows follow a regular pattern and totals use formulas that summarize adjacent data. Excel may not infer the hierarchy you intended if the layout is irregular, totals are typed as fixed values, or formulas do not clearly identify summary rows.

Auto Outline is a convenience, not a guarantee that the resulting groups match the report’s meaning. Inspect each level and correct unexpected groups with Group or Ungroup. For a carefully designed report, manual grouping usually gives more predictable control over which rows belong to each week, department, or reporting period.

Nested groups compared with filters and hidden rows

Grouping is different from filtering. A filter displays records that meet selected criteria, such as transactions for one region or dates within a range. An outline collapses a planned section of adjacent rows, whether or not those rows meet a condition. Use filters when readers need to select data dynamically; use groups when the report has a stable hierarchy and readers need to switch between detail and summary views.

Grouping is also different from manually hiding rows. You can hide rows through the row-heading context menu, but individual hidden rows do not create a navigable hierarchy with outline levels. A group gives readers visible controls to expand or collapse a meaningful range. It is also not the same as an Excel Table: a table organizes records and provides table-specific sorting and filtering, while an outline controls the visibility of worksheet rows. A report can use tables and outlines for different purposes, but the outline applies to complete worksheet rows.

Choose the simplest feature that fits the task. A large raw data list is often easier to analyze with filters, a PivotTable, or a summary report than with many layers of manually grouped rows. An outline is most useful when the layout itself already has clear sections and subtotals.

Common problems and how to fix them

  • The wrong rows disappear. Expand the outline, select the correct row-number range, and regroup it. Remember that a row group affects the whole worksheet row, including cells outside the report area.
  • The subtotal vanishes when detail collapses. Check whether the summary row is above or below the detail and review Outline Settings. You may also have included the summary row in an inner group when it should remain visible at that level.
  • There are no plus and minus controls. Confirm that a group exists, that outline symbols are enabled for the worksheet, and that the sheet is not protected against the change you are trying to make.
  • The outline has too many levels or is confusing. Ungroup unnecessary levels and keep only meaningful distinctions, such as month and week. A group for every single row rarely helps readers.
  • Rows appear hidden after reopening the file. The workbook may have been saved while groups were collapsed. Expand the relevant level; collapsing changes visibility, not the stored values.

When a worksheet is protected, grouping or expanding an outline may be restricted by its protection settings. If you have permission to change the workbook, review the sheet protection options or ask its owner to adjust them. Do not remove protection on a shared or controlled workbook without authorization. If a report is frequently edited by several people, document the hierarchy or use clearly labeled subtotals so its structure is understandable even when the outline is expanded.

Frequently Asked Questions

Can Excel have groups inside groups?

Yes. Group the smaller row ranges first, then group a larger range containing those groups. Excel represents the result with multiple outline levels, up to eight. The groups should use adjacent worksheet rows and a consistent summary-row layout.

How do I group rows in Excel with a keyboard shortcut?

On Windows, select the rows and press Alt+Shift+Right Arrow to group them. The corresponding ungroup shortcut is Alt+Shift+Left Arrow. Keyboard behavior can depend on Excel version and the active selection; the ribbon route, Data > Outline > Group, is a reliable alternative. On Mac, use the Data tab’s Group command because Windows Alt-key shortcuts do not translate directly to Mac keyboards.

Can I group rows that are not next to each other?

An outline group is a contiguous range of worksheet rows. To make separate groups for nonadjacent sections, create one group for each section. If you need to show records based on a shared value rather than their physical position, use a filter or another analysis tool instead.

Does collapsing a group delete or change data?

No. Collapsing hides the grouped rows from view; it does not delete their contents. Expand the group to see them again. Because rows are hidden rather than removed, review formulas and any visibility-dependent calculations if the report’s results need to respond to hidden rows.

Can I group rows in Excel for Mac or Excel for the web?

Excel for Mac also provides grouping commands on the Data tab, though labels and ribbon layout can differ by release. Excel for the web may display and let you interact with outlines, but available editing commands can vary. If Group is unavailable in your version or workbook, open it in the desktop Excel app and use Data > Group.

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.