In Excel for Microsoft 365 on Windows, select the row headers you want to group, then choose Data > Outline > Group. Click the minus sign beside the rows to collapse them, or the plus sign to expand them; grouping hides detail temporarily rather than deleting it.
How row grouping works
Grouping adds an outline to a worksheet. The outline gives related rows a shared control, so a reader can switch between a compact view and the underlying detail without removing or moving any data. For example, a monthly sales sheet might show a subtotal for each region while allowing a user to hide or reveal the individual transactions that make up each subtotal.
When a group is expanded, its rows appear normally. When it is collapsed, Excel conceals those rows and displays the remaining worksheet rows, including any summary row outside the group. The hidden information remains in its original cells, and formulas that refer to it are not erased. This makes grouping useful for reports people need to inspect at different levels of detail.
Excel displays outline controls next to the row numbers. A minus sign indicates an expanded group; clicking it collapses the group and changes the control to a plus sign. Outline level buttons, usually numbered 1, 2, and so on, let you show a broader or more detailed level across the sheet. The exact number of levels depends on how the groups are arranged.
How to group rows step by step
- Make sure the rows you intend to group are together in the worksheet. If the range has a heading row or a subtotal row that should stay visible, leave that row outside the selection.
- Select the row headers by dragging over their numbers at the left edge of the sheet. For example, selecting row numbers 5 through 10 selects all of those rows, not just the cells currently visible in one column.
- Choose Data > Outline > Group on the ribbon. If you selected entire row headers, Excel normally groups rows directly. If you selected cells instead, a dialog may ask whether to group Rows or Columns; choose Rows.
- Check that the outline bracket covers the intended range and that the minus control appears beside it. Click the minus sign to test the collapsed view, then click the plus sign to restore the detail.
For a quick Windows shortcut, select the rows and press Alt+Shift+Right Arrow to group them. The ribbon command is often easier to remember and is a good choice when the shortcut is intercepted by a keyboard layout or another application. In Excel for Mac, select the row headers and use the Group command on the Data tab; ribbon placement can vary with the version and window width, so the menu command is a dependable alternative to relying on a shortcut.
To include only part of a row, select the row numbers anyway. Excel grouping is a worksheet outline operation, so it hides or reveals whole worksheet rows across all columns. It does not group only the selected cells in a row.
Collapse, expand, and navigate an outline
Use the plus and minus controls when you want to change one group at a time. This is helpful when checking a particular subtotal or opening one section of a long report while keeping other sections compact. The controls affect visibility, not the values or formulas in the rows.
Use the numbered outline buttons when you want to change several groups together. A lower outline level shows a more summarized view; a higher level reveals more nested detail. For example, a sheet organized by year, quarter, and month could have a top level showing yearly summaries, a middle level showing quarters, and a deeper level showing months. The levels available depend on the outline structure that has been created.
If the plus and minus signs are missing even though you expect an outline, check whether Excel is set to display outline symbols. In Windows, go to File > Options > Advanced, find Display options for this worksheet, and check Show outline symbols if an outline is applied. Also check that the correct worksheet is selected in that section. A narrow window or a collapsed ribbon can make commands harder to locate, but it does not remove the outline itself.
Create nested groups for levels of detail
Nested groups let a worksheet summarize information at more than one scale. Imagine a project report with a summary row for each department, a subtotal for each team, and individual task rows beneath each team. Group the task rows first, then group the team sections at the next level. The outline can then expose department totals, team totals, or task-level detail as needed.
Build the hierarchy from the smallest sections outward. Select the detail rows beneath a subtotal and group them. Repeat for each comparable section. Then, if a larger section should also collapse, select its rows or the smaller groups it contains and create the outer group. After each operation, use the level buttons and plus/minus controls to confirm that the display behaves as intended.
Keep summary rows outside the detail group when the goal is to leave those summaries visible after collapsing. A common layout places the detail lines first and the subtotal immediately after them. In that arrangement, grouping only the detail lines leaves the subtotal showing. If the summary appears above its detail instead, select only the detail rows and verify the result; do not assume Excel will infer which row is meant to remain visible.
For a worksheet with many sections, consistent row order matters. If subtotal rows are mixed into the middle of detail ranges, or if sections overlap accidentally, the outline can be confusing. Before building a deep outline, make a copy of the worksheet or save the workbook, then test a small section. This is especially useful when other people depend on the current layout.
Grouping, hiding, filtering, and subtotals
Grouping is not the same as manually hiding rows. To hide rows, select their row headers, right-click, and choose Hide; to show them again, select the surrounding row headers, right-click, and choose Unhide. Hidden rows do not provide the same outline hierarchy or the convenient expand-and-collapse controls. Use manual hiding for a one-off presentation change, and grouping when readers should be able to navigate organized sections repeatedly.
Filtering answers a different question. A filter displays records that meet chosen criteria and temporarily hides records that do not. For example, a filter can show transactions from one region or dates within a selected period. Grouping instead collapses a planned block of adjacent rows, regardless of the values in those rows. A filtered list can be useful for searching or analysis, while an outline is useful for presenting a known hierarchy.
Subtotals are calculations, not just visibility controls. Excel’s Subtotal feature can insert summary rows and create an outline around groups of records, usually when the data is sorted by the field being summarized. If you only need to organize existing rows, use Group. If you need Excel to insert subtotal calculations for categories, consider Data > Subtotal, after arranging the source data appropriately. A PivotTable is another option when the goal is to summarize and rearrange a dataset rather than manage a fixed worksheet layout.
Common problems and practical fixes
- The wrong rows collapse: Expand the group, inspect the bracket beside the row numbers, and select the correct row headers before grouping again. If a group is misplaced, ungroup that range and recreate it rather than adding more overlapping groups.
- There is no plus or minus control: Confirm that a group was created and that outline symbols are enabled for the worksheet. Also look at the left edge near the row headers, where Excel places the controls.
- The subtotal disappears with the details: The subtotal row was probably included in the grouped range. Expand the group, ungroup the affected rows, and regroup only the detail rows so the summary remains outside the group.
- A group will not include distant rows: Excel outlines work with contiguous ranges. Make separate groups for separate blocks instead of selecting nonadjacent row headers and expecting one group to cover them.
- The worksheet becomes hard to read: Too many nested levels or inconsistent summary placement can make the outline difficult to use. Simplify the hierarchy, use consistent section layouts, and test the level buttons before sharing the workbook.
Grouping does not make a worksheet private or protect its contents. A person who can work with the sheet may be able to expand the outline or otherwise inspect its data. If information must be restricted, use appropriate workbook access and protection practices rather than treating a collapsed group as security.
Remove a group or clear an outline
To remove one group while keeping its rows and values, select the grouped row headers and choose Data > Outline > Ungroup. If Excel asks what to ungroup, choose Rows. The rows remain in place; only that outline grouping is removed. You can also use the Windows shortcut Alt+Shift+Left Arrow after selecting the grouped rows.
To remove all outline groups from the current worksheet, choose Data > Outline > Ungroup > Clear Outline. This clears the outline structure, not the worksheet data. Use Clear Outline when you want to start over across the sheet; use Ungroup when you want to change one section and preserve the rest. If the rows were hidden manually rather than grouped, clearing an outline will not necessarily reveal them; use Unhide for rows hidden by that separate command.
Frequently Asked Questions
Can I group nonadjacent rows in Excel?
Not as one continuous outline group. Excel groups a contiguous block of worksheet rows. Create separate groups for separate blocks, or consider filtering if the goal is to show records scattered through a list based on a shared value.
Does grouping rows delete data or change formulas?
No. Grouping changes whether rows are displayed, not the cell contents. A collapsed group can still contribute to formulas, although functions such as SUBTOTAL can treat filtered or manually hidden rows differently depending on the function number used.
How do I group rows but keep the total visible?
Place the total outside the detail range you select. For a detail block followed by a subtotal, select and group only the detail rows. Collapse the group and confirm that the subtotal remains on screen.
How do I expand every group at once?
Click the highest outline level button shown for the worksheet to reveal the corresponding level of detail across the outline. You can also click individual plus signs to expand only selected groups.
Can I group columns instead of rows?
Yes. Select the column letters you want to outline, then choose Data > Outline > Group. Excel displays controls above the column headings. The same basic ideas apply: select a contiguous range, keep summary columns outside the detail group when needed, and use the outline controls to collapse or expand it.
Related
- How to Hide Columns and Rows in Numbers on iPhone
- How to Compare Two Lists in Google Sheets Step by Step
- DAX Measure to Count Rows: COUNTROWS Explained
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel PivotTable Shortcut: Insert One from Your DataIn Excel for Microsoft 365 on Windows, select a cell in your data and press Alt, N, V,…
- Hanging Indent in Word: Shortcuts and Formatting TipsIn Word for Microsoft 365 on Windows, select the paragraph or paragraphs and press Ctrl+T to create a…
- Schedule an Email in Outlook Monthly with Power AutomateOutlook does not have a built-in option to send the same email on a monthly repeat. To automate…
- Unable to Delete Emails in Outlook Archive? What to DoIf you cannot delete emails from an Outlook archive, first check what “archive” means in your case: the…
- PowerPoint Template Page: How to Create a Reusable SlideTo create a reusable template page in PowerPoint, build its design as a custom layout in Slide Master…
- Google Sheets IF Syntax: Examples and Common ErrorsIn Google Sheets, IF syntax is =IF(condition, value_if_true, value_if_false): it checks a condition and returns one result when…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.