How to Group Rows in Excel for Clearer Worksheets

How-to basics · Updated November 21, 2026

To group rows in Excel, select the row numbers you want to collapse, then choose Data > Outline > Group; if Excel asks whether to group rows or columns, choose Rows. Excel adds outline controls beside the row numbers so you can hide and reveal the selected detail without deleting it.

What row grouping does

Grouping creates an outline: a set of worksheet rows that can be shown or temporarily collapsed with a minus or plus button. It is useful when a worksheet has detail that matters but does not need to be visible all the time. For example, a monthly budget might show one total row for each month, with the individual expense entries grouped underneath.

When you collapse a group, Excel hides its rows; the cells and their contents remain in the worksheet. Formulas that refer to those cells continue to work. Grouping is therefore different from deleting rows, and it is also different from filtering data. An outline is a manual structure that you define, while a filter displays records that meet selected conditions.

Excel can create several levels of groups. A reader might first collapse each month’s transactions, then collapse all the months in a quarter. The outline level buttons, usually numbered 1, 2, and so on, let you show a broader summary or expand the detail to a chosen level.

Group a block of rows on Windows

In Excel for Microsoft 365 on Windows, use the row headers to select the rows. The row header is the numbered strip along the left edge of the grid. Selecting the row numbers makes your intention clear and avoids accidentally grouping columns.

  1. Click the number of the first row in the block.
  2. Hold Shift and click the number of the last row. You can also drag across the row numbers. For example, select row headers 5 through 12 to group rows 5–12.
  3. Open the Data tab and, in the Outline group, choose Group.
  4. If a dialog asks whether to group Rows or Columns, select Rows and confirm.

A bracket appears beside the grouped rows, along with a minus button. Click the minus to collapse the block; the button changes to a plus. Click the plus to show the rows again. The outline level buttons at the top-left of the worksheet can collapse or expand groups across the sheet at once.

You can also select cells spanning the rows rather than the row headers. Excel may then ask whether you want to group rows or columns. Check the selection before confirming: if it includes the wrong direction, cancel and select the row headers instead.

Create nested groups and summary rows

Nested groups represent a hierarchy. Suppose rows 2–25 contain four weeks of sales, with each week’s transactions followed by a weekly total. Group each week’s transaction rows separately, leaving its total outside the group. Then select the whole quarter’s detail and weekly totals, as appropriate, and create a larger outer group. Collapsing an inner group hides one week; collapsing the outer group hides the entire quarter’s detail.

Plan the layout before grouping. A summary row placed outside its detail group remains visible when that group is collapsed. This makes it possible to display totals while hiding the records used to calculate them. In a common layout, detail rows come first and the summary row follows them. If you need summary rows above detail, Excel has an outline setting for that arrangement.

To change the position setting, open the Data tab and use the small dialog launcher in the Outline group to open the Settings dialog. Clear Summary rows below detail if your summary rows are above the rows they summarize. This setting affects how Excel treats summary rows when creating outlines; it does not rearrange the worksheet or calculate totals for you.

For predictable nested outlines, create the smallest groups first and then create the larger groups around them. Keep group boundaries aligned with the data they represent, and leave headings or totals outside a group when they should remain visible after collapsing.

Group several sections and use shortcuts

To group separate sections, create a group for each contiguous block in turn. For instance, select the rows for January’s detail and group them, then repeat for February and March. The groups do not need to touch one another. Avoid trying to select scattered, nonadjacent row blocks and expecting one clean outline group; separate blocks are easier to control and troubleshoot.

On Windows, after selecting the rows, press Alt+Shift+Right Arrow to group them. Press Alt+Shift+Left Arrow to ungroup the selection. Keyboard layouts and Excel versions can affect shortcut behavior, so use Data > Outline > Group or Ungroup if a shortcut does not work. On Mac, the Data tab’s Group and Ungroup commands are a dependable alternative because keyboard shortcuts can differ by version and keyboard configuration.

If the controls are present but hard to see, check the worksheet’s left edge and the area above the row numbers. Outline brackets and level buttons are displayed outside the cell grid. A narrow window or hidden row and column headings can make the controls less obvious; restoring the headings or widening the Excel window may help.

Ungroup rows or remove an outline

To remove one group while keeping its rows and data, select the grouped row headers and choose Data > Outline > Ungroup. If Excel asks which direction to ungroup, choose Rows. The selected rows return to the visible worksheet, but their contents are unchanged.

To remove all outline groups from a worksheet, open the Ungroup menu in the Outline group and choose Clear Outline. This removes the outline structure, not the worksheet data. Use it when the grouping is badly structured or no longer useful, but remember that clearing the outline removes all groups on that sheet, not just the one currently selected.

Ungrouping is not the same as expanding. Clicking the plus button reveals a group while preserving it; Ungroup removes the grouping control. If your goal is simply to view the detail temporarily, expand the group rather than ungrouping it.

Grouping compared with hiding, filters, and PivotTables

Choose grouping when you want a repeatable, visible hierarchy—for example, transaction rows under weekly totals. Choose Hide when you only need to conceal a few rows quickly and do not need outline buttons. To hide rows, select their headers, right-click, and choose Hide; to show them again, select the surrounding row headers, right-click, and choose Unhide.

Use filters when people need to find records by values such as region, date, or status. A filter can show matching records without requiring you to build manual groups, but it does not make a chosen set of rows into a collapsible section. A PivotTable is a better fit when you want Excel to summarize and reorganize data by categories, such as sales by month and product. PivotTable expand-and-collapse controls operate on the PivotTable’s fields, rather than on manually selected worksheet rows.

These features can coexist, but their effects can be confusing if several are applied at once. A row hidden by a filter or by Hide may not behave like a row collapsed through an outline. When something seems missing, clear or expand each mechanism separately rather than assuming the data was deleted.

Common grouping problems

If Group is unavailable or Excel does not create the expected outline, check the selection and worksheet state. Select complete row headers for a simple test, and confirm that the sheet is not protected in a way that prevents structural changes. If a workbook is shared or has other restrictions, those can also limit editing. The exact restriction depends on the workbook’s setup.

  • The wrong direction is grouped: Undo the action or ungroup it, then select row numbers and choose Rows if prompted.
  • The rows disappear and will not expand: Look for a filter, manually hidden rows, or a collapsed outer group. Expand the outline level or clear the filter before changing the group.
  • A total vanishes with the detail: The total row is probably inside the group. Ungroup, adjust the group boundary so the total is outside, and group the detail again.
  • There are too many or confusing controls: Review the outline one level at a time with the numbered buttons. If needed, choose Clear Outline and rebuild the structure in a deliberate order.
  • New rows do not join the group: Group boundaries do not always extend automatically when you add rows elsewhere. Check the bracket and group the new rows if necessary.

Excel also offers Data > Outline > Auto Outline in desktop versions. It can infer groups from summary formulas and the layout of a worksheet, but it may not interpret every report as intended. Review the resulting groups before relying on them, and use manual grouping when the intended structure is specific or the sheet has an unusual layout.

Frequently Asked Questions

Can I group rows without hiding them?
Yes. Grouping adds outline controls, but the rows remain visible until you click the minus button or choose a lower outline level. You can leave a group expanded and collapse it only when you need a summary view.

Does grouping rows delete or change their values?
No. Grouping changes how rows are displayed, not their contents. Collapsed rows are hidden from view, and formulas can still refer to their cells. Check formulas that use functions such as SUBTOTAL separately, since their results can depend on filtering or hidden-row settings.

How do I group rows in Excel for Mac?
Select the row headers, open the Data tab, and choose Group. If Excel presents a choice, select Rows. To remove a group, select its rows and choose Ungroup. The ribbon commands are preferable if a Windows keyboard shortcut does not match your Mac’s Excel version or keyboard.

Can I group rows automatically?
Use Data > Outline > Auto Outline if the sheet has a recognizable summary structure, often with formulas summarizing adjacent detail. Excel’s inference may not match your intended sections, so inspect the outline and adjust it manually when needed.

How do I show all grouped rows again?
Click the plus buttons for individual groups, or click the highest outline level button to show a broader view. Expanding reveals the rows but keeps the groups in place; use Ungroup only if you want to remove the outline structure.

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.