To group rows in Excel for Microsoft 365 on Windows, select the row numbers you want to group, then choose Data > Outline > Group. Excel adds an outline control so you can collapse those rows to hide their details and expand them again when needed.
Group rows with the ribbon or a shortcut
Grouping works best when the rows you select form one continuous block and contain detail that belongs together. For example, you might group the four rows listing January transactions beneath a January heading. The rows remain in the worksheet; grouping only lets you hide or show them as a unit.
- Make sure the worksheet has a clear structure, such as a heading or summary row followed by the detail rows.
- Select the row numbers along the left edge of the sheet for the rows to group. To select rows 5 through 8, click row 5, then drag down to row 8, or select row 5 and Shift-click row 8.
- Choose Data > Outline > Group. If Excel asks whether to group Rows or Columns, choose Rows.
- Use the minus sign beside the grouped rows to collapse them. Click the resulting plus sign to expand them.
On Windows, Alt+Shift+Right Arrow groups the selected rows. Alt+Shift+Left Arrow ungroups them. If a shortcut does not work on your computer, use the ribbon command; keyboard behavior can depend on the keyboard layout and Excel environment. Excel for Mac has a similar Group command on the Data tab, but shortcuts may differ by keyboard and version, so the menu route is the dependable option there.
You can select cells in the rows rather than their row numbers, but selecting the row headers makes your intention clear. When Excel displays the Rows/Columns choice, verify that Rows is selected before confirming.
How Excel row grouping works
Row grouping is part of Excel’s outline feature. An outline describes a hierarchy of detail and summary information. Grouped rows can be hidden together, while outline level buttons let you display broader or narrower levels of detail. The controls usually appear in the margin to the left of the row numbers, with plus and minus signs for individual groups and numbered buttons for outline levels.
Collapsing a group does not delete its contents, change their values, or move them to another worksheet. It hides the rows from view until you expand the group. Hidden detail can still affect calculations, and grouping is not a privacy or access-control feature: anyone with access to the workbook can expand the rows.
Excel supports nested groups. For example, a yearly report could have individual transaction rows grouped by month, with the monthly groups grouped again by quarter. The outline level buttons can then show all detail, monthly summaries, or only the top-level summaries, depending on how the outline is arranged. Keep the hierarchy logical; too many layers can make a sheet harder to navigate than simply leaving the data visible.
Groups are tied to worksheet rows, not to a visual label or a category value. If a group currently covers rows 5 through 8, inserting or deleting rows can affect its boundaries. After changing the layout, expand the outline and check that each group still contains the intended detail.
Plan the rows and summaries before grouping
A readable layout makes an outline more useful. Put each summary row directly above or below the detail it describes, and use consistent labels and formatting to distinguish totals from underlying records. In a monthly expense sheet, for instance, a January total can sit next to the January heading, with the individual expense rows grouped together beneath it. Users can then collapse the transactions while keeping the monthly summary visible.
Decide whether the summary should appear above or below its detail. Excel’s outline settings include a Summary rows below detail option. To inspect it, open the Data tab and use the small dialog launcher in the Outline group to open the Settings dialog. The setting controls where Excel expects summary rows when creating outlines; it does not automatically write totals or rearrange your worksheet. Check the layout before grouping, especially if the summary row is at the top of a section.
Before creating groups in a large report, consider whether the data is consistently sorted by the category you want to outline. Grouping does not sort rows or identify related records for you. If records for the same month are scattered across the sheet, grouping a block of adjacent rows will not gather them. Sort or reorganize the data first, taking care to sort complete records together so values in different columns do not become mismatched.
Create nested groups and use outline levels
To create a multi-level outline, first group the smallest detail blocks, such as the transaction rows within each month. Then select the larger blocks that contain those groups, such as several months within a quarter, and group them. Excel can show controls for each level. Click a numbered outline button to show that level of detail across the sheet; use plus and minus controls when you want to expand or collapse one specific block.
For example, imagine a report with a quarter heading, monthly summary rows, and several transaction rows under each month. Group the transactions for each month first. Then group the monthly sections under the quarter if you want to hide or reveal that larger block as well. The exact outline levels available depend on the groups you create and the summary-row arrangement.
Build and test one section before applying the same pattern to a long worksheet. Collapse it and confirm that the right summary remains visible; expand it and check that no detail row is missing. This small check helps catch a common layout mistake: including a summary row inside the group that should hide only the detail. If a summary disappears when you collapse a section, adjust the selected row range or revisit the outline settings.
Ungroup rows or remove an outline
To remove a group without deleting worksheet data, select the row numbers in that group and choose Data > Outline > Ungroup. The selected rows return to the normal worksheet view, and their group control is removed. On Windows, Alt+Shift+Left Arrow is the shortcut for ungrouping selected rows. If you select rows that belong to nested groups, pay attention to the selection: removing one level is different from removing every outline level.
To remove all outline groupings from a worksheet, use Data > Outline > Ungroup and choose Clear Outline if that option is available in the menu. This clears the outline structure, not the cell contents. It is a broader action than ungrouping one selected block, so use it only when you intend to remove the worksheet’s outline.
If rows are currently collapsed, expand the groups before selecting a specific block to ungroup. Otherwise, hidden row numbers can make it difficult to tell exactly which rows are included. Clearing an outline is also a useful way to reset a complicated structure and rebuild it, but first make sure the workbook does not rely on the outline for a particular report view.
Grouping compared with hiding, filtering, and PivotTables
These tools can all reduce what appears on screen, but they solve different problems:
- Grouping hides and reveals a selected block of worksheet rows while preserving a visible outline hierarchy. It is suited to reports where people need to switch between summaries and details.
- Hide Rows hides selected rows without adding outline controls. Use it for a simple, temporary change in view when users do not need expandable sections.
- Filter displays records that meet criteria, such as transactions from one month or a particular department. It is better when the user needs to choose which records appear based on their values, rather than collapse a fixed block.
- PivotTables summarize and organize a source dataset by fields such as month, product, or region. They are often a better fit when users need interactive summaries or the underlying records change frequently.
Grouping does not create a subtotal, calculate a sum, or guarantee that a summary matches its detail. If your report needs totals, add the appropriate values or calculations separately. Likewise, a filter does not create an outline hierarchy, and hiding rows does not provide the same convenient plus/minus controls. Choose the feature based on whether you need a fixed outline, a criteria-based view, or a summarized analysis.
Common problems and how to fix them
- The Group command is unavailable. Check that you are selecting worksheet rows and not editing a cell. If the sheet is protected, some structural changes may be restricted; review the sheet protection settings or ask the workbook owner. Also check whether the selection or workbook structure prevents the action.
- Excel groups columns instead of rows. Select row numbers, or choose Rows when Excel asks which direction to group. Selecting column letters can result in a column outline instead.
- The outline symbols are missing. Expand the groups using the outline level controls if they are visible, and inspect Excel’s outline display settings. A worksheet can be configured not to show outline symbols. Also check whether the outline controls are simply outside the visible portion of the left margin.
- Collapsing hides the summary too. The summary row may have been included in the selected group. Ungroup the section and create it again with only the detail rows selected, or check the summary-row setting.
- Rows from different categories end up together. Grouping follows the row range you select; it does not detect category labels. Sort the complete dataset by the relevant field, then create separate groups around contiguous blocks.
- The outline becomes confusing after edits. Expand all levels, inspect the row boundaries, and remove or rebuild groups that no longer match the report. Structural edits can make an old outline less intuitive, even when the underlying cell data is intact.
For a safer change to an important report, save a copy first. Grouping and ungrouping do not delete cell data, but making a copy gives you an easy way to compare the layout if a complex outline needs to be rebuilt.
Frequently Asked Questions
How do I group rows in Excel quickly?
Select the row numbers you want to group and choose Data > Outline > Group. On Windows, you can also press Alt+Shift+Right Arrow. Use the minus control to collapse the group and the plus control to expand it.
Can I group non-adjacent rows in Excel?
Excel outlines are designed around contiguous row blocks. To create separate groups for non-adjacent sections, group each contiguous block individually. If you need to show records from different parts of a dataset based on a value, sort or filter the data instead.
Does grouping rows hide or delete the data?
It hides rows from view when you collapse a group; it does not delete their contents. The data remains in the worksheet and can be displayed again by expanding the group. Grouping also does not protect hidden information from other workbook users.
How do I expand all grouped rows?
Click the highest outline-level button shown beside the row numbers to display the broadest level of detail. You can also expand individual sections using their plus signs. The available level buttons depend on the outline structure.
Can I group rows in Excel for the web?
Feature availability and controls can differ between desktop Excel and Excel for the web. The steps here describe Excel for Microsoft 365 on Windows. If the web app does not offer the outline command you need, open the workbook in the desktop app and use the Data tab’s Outline controls.
Related
- Excel Text to Columns: Split Alt+Enter Line Breaks
- Excel Text to Columns and Rows: How to Split Data
- Excel Text to Columns: How to Make Results Vertical
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Make a Flowchart in Word Easily, Step by StepTo make a flowchart in Microsoft Word, choose Insert > Shapes, select a shape from the Flowchart section,…
- Why Did My Outlook View Just Change?Your Outlook view usually changes because a display setting was switched, a different folder has its own view,…
- Excel Cell Phone Accessories in Clementi: What to KnowIf you mean a shop called Excel that sells cell phone accessories in Clementi, I can’t reliably confirm…
- Excel 365 Password Protection: How to Do It SafelyTo password-protect an entire Excel 365 workbook on Windows, open it and choose File > Info > Protect…
- Group Dates into Quarters in Excel: A Step-by-Step GuideTo group dates into quarters in Excel, put the date field in a PivotTable, right-click a date, choose…
- Searchable Dropdown in Excel UserForms: How It WorksYes. In an Excel VBA UserForm, a ComboBox can provide a searchable dropdown: its built-in autocomplete can complete…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.