Group Rows in Excel: Steps, Outlines, and Fixes

How-to basics · Updated November 3, 2026

Group Rows in Excel: Steps, Outlines, and Fixes

To group rows in Excel for Microsoft 365 on Windows, select the rows, then choose Data > Outline > Group > Group; if Excel asks whether to group rows or columns, choose Rows. Excel adds outline controls beside the row numbers so you can collapse the selected detail and expand it again without deleting or moving any data.

What Grouping Rows Does

Grouping creates an outline: a collapsible structure for rows on a worksheet. When a group is collapsed, its rows are hidden temporarily and a plus control appears beside the outline. Select the plus to show the rows again. Excel also displays numbered outline-level buttons near the upper-left corner of the sheet; selecting a level shows the rows and summary information assigned to that level.

For example, a monthly report might show twelve rows of transactions under each department. Group each department’s transaction rows, then collapse the groups to see a shorter report while keeping the details in the same worksheet. Grouping changes what is visible, not the underlying values, formulas, or row order. It is useful for reports people need to inspect at both summary and detail levels.

Grouping is not the same as sorting, filtering, or combining records. It does not automatically identify matching names or categories, and it does not merge cells. The rows you select become a group because you explicitly make an outline around them.

How to Group Rows Step by Step

  1. Arrange the worksheet so the rows you want to collapse sit together. Add a clear summary row if you want a visible total or label when the detail is hidden.
  2. Select the row numbers for the detail rows. Drag down the row headers to select a continuous block. You can also select cells in those rows, but selecting the row headers makes your intent clear.
  3. On the ribbon, select Data > Outline > Group > Group. If Excel presents a Rows or Columns choice, select Rows and confirm.
  4. Check the outline controls beside the row numbers. Select the minus control to collapse the group; select the plus control to expand it.

For instance, if rows 5 through 16 contain one department’s line items and row 17 contains its total, select rows 5 through 16 and group them. The total remains visible when the detail is collapsed if it is outside the selected group. The placement of summary rows matters: keep them outside the detail block if you want them to remain on screen.

On Windows, the keyboard shortcut to group selected rows is Alt+Shift+Right Arrow; Alt+Shift+Left Arrow ungroups them. In Excel for Mac, the corresponding shortcuts are Option+Shift+Right Arrow and Option+Shift+Left Arrow. Shortcuts can be affected by keyboard layout or system settings, so use the ribbon command if a shortcut does not work.

Collapse, Expand, and Read Outline Levels

Each group has a minus or plus control at its left edge. The minus collapses the group, while the plus expands it. A small bracket beside the row numbers indicates which rows belong to a group. These controls affect the view only; they do not remove rows from the worksheet.

For a sheet with several groups, the numbered buttons at the top-left are a faster way to change the overall view. Level 1 usually shows the most summarized view, while higher levels reveal progressively more detail. The exact visible rows depend on how the groups and summary rows were arranged. Select the highest displayed level to show all details again.

If the controls are not visible, first check whether an outline exists and whether outline symbols are enabled. In Excel for Windows, open the Data tab and look in the Outline group for the controls to show or hide outline symbols. Also check the worksheet’s row numbers: a collapsed group can make it seem as though rows are missing, but expanding the outline should bring them back.

Create Nested Groups for Multiple Detail Levels

Nested groups let readers expand a report in stages. Suppose each region contains several department totals, and each department contains transaction rows. Group the transactions within each department, then group the department sections within each region. The resulting outline can show a region-level summary, department totals, or individual transactions, depending on the selected outline level.

To build a nested outline reliably, start with the smallest detail blocks and work outward. Select and group the transaction rows for each department first. Then select the complete department sections, including the appropriate subtotal rows, and group those sections into regions. Review the outline buttons after each step; if a total disappears at a level where it should remain visible, adjust which rows are inside that group.

Excel supports up to eight outline levels. That is a maximum, not a target: a few meaningful levels are easier to use than a deeply nested outline that readers must repeatedly expand. Keep the hierarchy consistent, and place summary rows in predictable positions so the numbered controls produce a useful report at every level.

Group Rows Automatically with Subtotals

If the goal is to create grouped sections and calculate totals at each change in a category, Excel’s Subtotal command can build an outline while inserting subtotal rows. First sort the list by the category that defines each section. Then select a cell in the list and choose Data > Outline > Subtotal. In the dialog, set At each change in to the category column, choose a function such as Sum or Count, select the columns to subtotal, and confirm.

For example, sort a sales list by Region and use Subtotal with Region as the change field and Sum for the sales column. Excel inserts a regional total after each region’s records and a grand total, then creates outline controls for hiding or showing the transaction detail. Sorting first is important: if records for the same region are scattered through the list, Excel treats each separate run as a different section.

Subtotal is not the same as manually grouping existing rows: it inserts summary rows and calculates results, so inspect the output before relying on it. The command is intended for a normal range rather than an Excel table. If it is unavailable while your data is formatted as a table, convert the table to a range using Table Design > Convert to Range, if appropriate, and consider whether losing table features such as structured references and automatic expansion is acceptable. You can also add totals yourself and group rows manually.

Plan the Data and Choose the Right Method

Manual grouping is best when the sections already exist and you want control over exactly which rows collapse. Subtotal is useful when category changes should produce calculated totals and an outline. A PivotTable is often a better choice when you want to rearrange categories, summarize large lists, or explore the data without inserting subtotal rows into the source range.

  • Use a manual outline for a fixed report with known detail blocks, such as monthly expenses beneath each quarter.
  • Use Subtotal for a sorted list that needs an inserted total whenever a field changes, such as a count by product category.
  • Use a PivotTable when readers need to change the fields or layout of a summary, or when the source data should remain separate from the report.
  • Use filtering when the goal is to show records that meet a condition, such as one customer or one date range, rather than to create collapsible sections.

Keep each group contiguous: a single outline group covers a continuous block of worksheet rows, not scattered rows in different places. If related records are separated, sort or reorganize a copy of the data before grouping, or use a PivotTable or filter instead. Leave a header row outside the detail group when it should remain visible, and label summary rows so a collapsed view still makes sense.

Ungroup Rows and Remove an Outline

To remove one group while leaving other groups in place, select its rows and choose Data > Outline > Ungroup > Ungroup. If prompted to choose Rows or Columns, select Rows. The rows remain on the sheet; only their grouping relationship is removed. The Windows shortcut Alt+Shift+Left Arrow performs the same kind of ungrouping on a selected outline.

To remove all outline groups from a worksheet, choose Data > Outline > Ungroup > Clear Outline. This removes the outline structure, not the data. Take care not to confuse clearing an outline with deleting rows: clearing the outline changes how rows can be collapsed, while deleting rows removes worksheet content.

For a subtotal-generated outline, removing groups does not necessarily remove the inserted subtotal rows. If you want to remove those calculations too, use the Subtotal dialog’s Remove All command, and verify the resulting list. Keep a copy of important data before changing a generated report, especially if it contains manually added totals or formatting.

Common Problems and Practical Fixes

  • Group is unavailable: Confirm that you selected worksheet rows or cells in the intended range and that the sheet is not protected in a way that blocks the operation. If the data is an Excel table, try a normal range or create a separate report area. Ribbon availability can also differ in Excel for the web.
  • The wrong rows disappear: Expand every group, check the row numbers, and regroup the precise continuous block. A summary row selected by mistake will disappear with the detail.
  • Rows seem lost: Look for a plus control or a lower outline level and expand it. Grouping hides rows; it does not delete them.
  • Totals vanish when collapsed: The total is probably inside the selected group. Ungroup and recreate the outline with the detail rows grouped separately from the summary row.
  • Groups appear in the wrong order: Manual grouping follows worksheet row positions, not alphabetical or category relationships. Sort the data before creating groups, or use a PivotTable for a rearrangeable summary.
  • Outline buttons are missing: Check the Data tab’s outline controls and the setting for displaying outline symbols. Also confirm that the sheet contains a group rather than merely hidden rows.

Grouping and hiding are related but not interchangeable. Hiding rows manually can conceal information, but it does not create the same nested outline controls or convenient level buttons. Conversely, a group is not a security feature: a user who can access the workbook may expand it or unhide rows. Do not use grouping to protect confidential information.

Frequently Asked Questions

Can I group nonadjacent rows in Excel?
Not as one ordinary outline group. A group covers a continuous block of rows. Create separate groups for separate blocks, or use filtering or a PivotTable if the records are scattered.

How do I group rows without including the total?
Select only the detail rows, leaving the total row outside the selection. Then use Data > Outline > Group. When you collapse the group, the separate total row can remain visible.

Does grouping rows change or delete the data?
No. Grouping hides selected rows when collapsed and shows them again when expanded. It does not change cell values, formulas, or row order. Clearing an outline removes the grouping structure, not the rows.

Can Excel group rows automatically by matching values?
Manual Group does not detect matching values. To create category totals and an outline from a sorted list, use Subtotal; for a flexible summary by category, use a PivotTable.

Can I group columns as well as rows?
Yes. Select the columns and use Data > Outline > Group. If Excel asks which direction to group, choose Columns. Column groups use similar plus, minus, and outline-level controls.

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.