How to Group and Expand Rows in Excel: A Practical Guide

How-to basics · Updated November 21, 2026

To group rows in Excel for Microsoft 365 on Windows, select the row numbers you want to fold away, then choose Data > Group > Group and select Rows if prompted. Use the minus button beside the row numbers to collapse the group and the plus button to expand it again. Grouping creates a reusable outline; it hides and shows rows without deleting their contents.

What You’ll Need

  • An Excel workbook with a worksheet containing the rows you want to organize. Save a copy first if the worksheet is important.
  • Permission to make changes to the worksheet. A protected sheet may prevent grouping or changing its outline.
  • For best results, a clear layout with detail rows kept together and any subtotal or summary row outside the group.

Step-by-Step

  1. Choose a suitable block of rows. Identify a consecutive set of detail rows that readers may want to hide temporarily, such as the monthly transactions beneath a quarterly total. For example, if rows 5 through 10 contain transaction details and row 11 contains the total, group rows 5:10. Leave the total visible so it can still be read when the details are collapsed. Grouping is most useful when the worksheet has a consistent structure and the summary remains easy to understand on its own.
  2. Select the row headers. Click the number 5 at the left edge of the worksheet, then drag down to row 10. The row headers should highlight across the full width of the sheet. You can also click row 5, hold Shift, and click row 10 to select the range. Selecting row numbers is a reliable way to tell Excel that you intend to group entire rows rather than columns or just a few cells. If you select cells instead, Excel may still infer the direction, but check the prompt in the next step.
  3. Apply the group. Open the Data tab on the ribbon. In the Outline section, choose Group, then choose Group if the menu offers a choice. If Excel opens a dialog asking whether to group Rows or Columns, select Rows and confirm with OK. The selected detail rows become an outline group, and a bracket line with an outline control appears to the left of the row numbers. If you cannot find Group, widen the Excel window or look for the Outline section on the Data tab; ribbon commands can become compact when the window is narrow.
  4. Collapse the rows. Click the minus sign at the left of the bracket that covers the grouped rows. Excel hides rows 5 through 10 in this example, while row 11 remains visible. The minus sign changes to a plus sign. Clicking the plus sign later expands the group and reveals the rows again. A hidden group is not deleted: its cell values, formulas, and formatting remain in the worksheet.
  5. Use outline levels for a quick overview. When Excel has created an outline, numbered level buttons appear near the upper-left corner of the sheet, often labelled 1, 2, and so on. Click a level number to show that level of detail throughout the worksheet. For instance, level 1 commonly displays only summary rows, while level 2 displays the summaries plus the first level of detail. The exact levels depend on how many groups and nested groups the sheet contains. Use the plus and minus controls when you want to open or close just one group.
  6. Create additional groups for other sections. Select another consecutive block of detail row headers and repeat Data > Group > Group. Excel can maintain several separate groups on the same worksheet. For example, you could group the detail under each monthly subtotal, then use the level buttons to show a compact overview or expand one month at a time. Avoid selecting several separated ranges and expecting Excel to make independent groups from one action; create each separate group individually for clearer results.
  7. Make a nested outline when it helps. You can group smaller blocks inside a larger block. Suppose rows 5:10 are the detail for January and rows 12:17 are the detail for February, while rows 4:18 are all the detail for a quarter. Group the monthly blocks first, then select the full quarterly detail range and group it as well, keeping the quarterly summary outside that range. Nested outlines let readers collapse individual months or the entire quarter. Test the plus and minus controls after each group so you know which rows each bracket controls.
  8. Expand or remove a group when finished. Click the plus sign to expand a collapsed group. To remove an outline without deleting worksheet data, select the grouped row headers, choose Data > Ungroup > Ungroup, and choose Rows if asked. To remove all row and column outlines from the active worksheet, choose Data > Ungroup > Clear Outline. Clear Outline removes the outline structure, so use it only when you want to remove all groups on that sheet rather than just open them.

Common Mistakes

Grouping the summary row by accident. If the subtotal or heading is inside the group, it disappears when you collapse the details. Select only the rows that should be hidden and leave the summary outside. If you need the summary above the details, the same principle applies: exclude that summary row from the selected range.

Confusing grouping with hiding rows. Right-clicking a row number and choosing Hide hides rows, but it does not create the same outline controls. If you want a repeatable expand-and-collapse structure, use Data > Group. Conversely, if rows are already hidden manually, an outline group may not make them visible; unhide them before checking whether the grouping worked.

Selecting cells or columns unintentionally. Selecting a range inside the worksheet can lead to a Rows or Columns prompt, and choosing the wrong direction creates an outline on the wrong axis. Select the row-number headers and confirm that the bracket is beside the rows you intended to group.

Making groups that overlap without a plan. Overlapping or nested ranges can be confusing if the summary rows and detail ranges are inconsistent. Sketch the outline first: decide which rows belong to each section, which rows are summaries, and whether groups should nest. Build the smaller groups before the larger parent group.

Tips

  • Use a consistent pattern: place each summary row immediately before or after its details, and keep the detail range predictable. That makes the outline easier to maintain when rows are added.
  • For a quick keyboard alternative on Windows, select the row headers and press Alt+Shift+Right Arrow to group. Press Alt+Shift+Left Arrow to ungroup the selected rows. On Mac, the corresponding shortcuts are generally Option+Shift+Right Arrow and Option+Shift+Left Arrow; keyboard behavior can vary by Excel version and macOS settings, so use the Data tab if a shortcut is intercepted.
  • If you want summary rows above their details, check the outline setting before grouping. In Windows desktop Excel, use the dialog launcher in the Data tab’s Outline section to open the Settings dialog, then clear Summary rows below detail. The default is usually to place summaries below detail, so leave the setting selected when that matches your layout.
  • Use clear labels such as Total for Q1 or January detail so the worksheet remains understandable when most rows are collapsed. Consider freezing header rows as well, especially in a long worksheet, so column headings remain visible while you scroll.
  • Grouping is for organizing a worksheet view, not for filtering records or controlling access. Use AutoFilter or a table filter to show records that meet conditions; use sheet protection or file permissions when you need to control editing or access.
  • In Excel for Mac, use the Data tab’s Group and Ungroup commands; the ribbon layout may differ slightly from Windows. Excel for the web may show outline controls and grouping commands, but available options can vary. If a command is missing or the outline is difficult to manage, open the workbook in the desktop Excel app.

Troubleshooting

The plus and minus controls are missing. First confirm that a group was applied by selecting the relevant rows and checking Data > Group. If the outline exists but its symbols are hidden, open File > Options > Advanced. Under Display options for this worksheet, turn on Show outline symbols if an outline is applied to the worksheet. Also check that you are viewing the worksheet rather than a print preview or another view that makes the controls difficult to see.

Clicking the control hides the wrong rows. Expand the group, inspect the bracket line beside the row numbers, and confirm which rows it spans. If you grouped the wrong range, select that range and use Data > Ungroup > Ungroup, then select the intended detail rows and group again. If you have nested groups, try the level buttons to understand which level is currently displayed before changing the outline.

Rows remain hidden after expanding. The rows may have been hidden manually, filtered out, or hidden by a different group. Clear any active filters, then select the row headers above and below the missing range, right-click, and choose Unhide. Expand the relevant outline level and check again. Remember that a group control expands only its own group; it does not necessarily reveal rows hidden by a filter or separate manual hiding.

Excel will not let you group or ungroup. Check whether the worksheet is protected and whether you have permission to edit it. If appropriate, use Review > Unprotect Sheet, enter the password if required, and try the grouping command again. If the workbook is shared or opened read-only, save an editable copy or ask the owner for access. Avoid changing protection settings on a shared workbook without confirming that you are allowed to do so.

The outline looks different after adding rows. New rows inserted just outside a group may not become part of it automatically. Expand the outline, select the complete intended detail range including the new rows, and group it again if necessary. Check that any subtotal formulas include the added records; grouping changes visibility, not the calculation range.

Frequently Asked Questions

Does grouping rows delete or change their data?
No. Grouping only collapses or expands the display of selected rows. It does not remove cell contents or change formulas. If a formula’s result changes after editing the data, that is separate from the outline operation.

Can I group nonadjacent rows together?
Not as one ordinary contiguous row group. Group each separate block independently. If you need to display records based on a condition rather than their position in the worksheet, use a filter instead of trying to combine separated rows into one outline.

How do I expand every group at once?
Click the highest outline level button at the upper-left of the worksheet. That displays the most detailed level available. To collapse groups to a summary view, click a lower level button, commonly level 1. The number of levels depends on the worksheet’s outline.

Can I group columns as well as rows?
Yes. Select the column letters you want to group, then choose Data > Group > Group and choose Columns if Excel asks. The outline controls appear above the column headings. The same plus and minus controls expand or collapse the column group.

Will the row groups remain when I save the workbook?
Yes. The outline structure and its expanded or collapsed state are saved with the workbook in normal Excel formats such as .xlsx. Save the file after setting the view you want other people to see when they open it.

Is grouping the same as creating a PivotTable?
No. Grouping rows folds selected worksheet rows into an outline but leaves the table layout and data in place. A PivotTable summarizes and rearranges source data. Use row grouping for a manual report layout, and use a PivotTable when you need to analyze or summarize records dynamically.

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.