To group rows beneath a heading in Excel, select the detail rows by their row numbers, then choose Data > Group > Group and confirm Rows. Excel adds outline controls so you can collapse the detail rows while leaving the heading visible. Grouping hides rows temporarily; it does not delete their contents.
What You’ll Need
- A workbook in Microsoft Excel for Microsoft 365, preferably the Windows desktop app for the ribbon paths below.
- A block of adjacent detail rows and, if you want a label to remain visible when the group is collapsed, a separate heading row immediately above that block.
- A saved copy of your workbook if it contains important data. Grouping is reversible, but a copy is useful before changing a complicated outline.
Step-by-Step
- Arrange the heading and detail rows. Put the label or summary you want to keep visible in its own row above the rows to group. For example, place “North Region” in row 2 and the region’s detail records in rows 3 through 7. Keep the data in a continuous block; blank rows can make it less clear which records belong in the section.
- Select only the detail rows. Click the row number 3, hold the mouse button, and drag down to row 7. The selected row numbers should be highlighted. You can also click row 3, hold Shift, and click row 7. Selecting row headers selects whole rows, which is a straightforward way to avoid accidentally grouping only part of the data. Do not include row 2 if you want the North Region heading to remain outside the group.
- Open the grouping command. On the ribbon, select Data > Group > Group. If you selected complete rows, Excel may create the row outline immediately. If a dialog appears asking what to group, choose Rows and select OK. The wording and layout can vary slightly with ribbon size, but the command is on the Data tab in the Outline area.
- Check the outline controls. Look along the left edge of the worksheet beside the row numbers. You should see a bracket covering the grouped rows and a minus button near the group. Click the minus button to collapse the detail rows. The heading row above the group should remain visible. A plus button appears in its place; click it whenever you want to expand the rows again.
- Use the outline level buttons for a quick view. Small numbered buttons, such as 1 and 2, may appear above the row numbers. Click level 1 to show the most summarized view of the sheet, or level 2 to show the next level of detail. The exact number of levels depends on how many groups or nested groups the worksheet has. These buttons affect the outline display, not the underlying data.
- Set the summary-row position if needed. If Excel’s outline controls appear on the wrong side of your detail rows, you can adjust the worksheet’s outline setting in desktop Excel for Windows. Select Data, open the dialog box launcher in the Outline group, and review Summary rows below detail. Clear that option when your summary or heading rows are above the detail. This setting affects how Excel positions summary rows in outlines; it does not replace selecting the correct detail rows. If you only need a plain heading above a group, leaving that heading outside the selection is the key step.
- Repeat for other sections. Select the detail rows for the next heading and use the same grouping command. Keep each group’s row range separate and aligned with its heading. For example, if the next section has details in rows 9 through 12, group rows 9 through 12 without including the heading row above them.
- Save and verify the collapsed view. Collapse each group you want hidden, check that the intended headings or totals remain visible, and save the workbook. Reopen a group before editing its details. In Excel for Mac, the Data tab also provides grouping commands; the exact ribbon arrangement can differ. On Mac, the grouping shortcut is generally Option+Shift+Right Arrow. In Windows desktop Excel, the shortcut is Alt+Shift+Right Arrow. If a shortcut is intercepted by your keyboard or system, use the ribbon command instead.
Common Mistakes
Including the heading in the group. If you select the heading row along with its details, collapsing the group hides the heading too. Select only the rows you want to fold away, leaving the label or summary outside the group. If the heading has already been hidden, click the plus control to expand the group, then ungroup and select the correct range again.
Selecting columns or cells by accident. Excel can group columns as well as rows. If you select column letters, or select cells in a way that makes the intended direction unclear, Excel may ask whether to group rows or columns. Choose Rows, or cancel and select the row numbers first.
Assuming grouping deletes data. A collapsed group is hidden, not removed. The values and formulas are still in the worksheet and can still affect calculations. Conversely, grouping does not calculate a subtotal for you. Add formulas or summary values separately if you need totals displayed in the heading row.
Grouping nonadjacent sections in one action. A single outline group is intended for a continuous range. Create separate groups for separate sections rather than trying to include unrelated rows in one selection. Watch for unintended blank rows in the selected range, too: those rows will be hidden when the group collapses.
Tips
- Use meaningful labels in the visible heading rows, such as a month, department, or category. A collapsed worksheet is much easier to navigate when each section explains what it contains.
- Keep the outline simple. One group per section is usually easier to manage than several overlapping groups. If you need detail within a section, create a nested group by grouping a smaller, contiguous block inside the larger section.
- For nested groups, test the controls at each level. A higher-level group can hide a whole section, while a lower-level group can hide only a subsection. Click the numbered outline buttons to see how the different levels behave.
- Use Data > Ungroup to remove a selected group, or choose Data > Ungroup > Clear Outline if you want to remove all outline groupings from the sheet. Clearing an outline removes the grouping controls, not the data in the rows.
- Freeze panes and grouping solve different problems. Freezing keeps selected rows or columns visible while you scroll; grouping lets you collapse and expand detail. You can use both when a large worksheet needs a persistent header and collapsible sections.
- When you share the workbook, save it with the groups in the view you want recipients to see. They can expand or collapse groups themselves, but the saved display determines the initial view when they open the file.
Troubleshooting
No plus or minus controls appear. First confirm that the grouping command completed and that the selected range contained rows. In Windows desktop Excel, check File > Options > Advanced, then find Display options for this worksheet and make sure Show outline symbols if an outline is applied is enabled. If the command is unavailable or the worksheet is protected, check the sheet’s protection settings; you may need permission to change the outline.
The heading disappears when you collapse the rows. Expand the group, then inspect its bracket and selected range. If the heading row is included, use Data > Ungroup for that group and make a new group using only the detail rows. Keep the heading in the row immediately above the group so it is easy to identify the section.
Excel groups columns instead of rows. Undo the change with Ctrl+Z in Windows or Command+Z on Mac, select the row-number headers, and run Data > Group > Group again. If Excel asks you to choose, explicitly select Rows.
The controls are on the wrong side of the section. Review the Summary rows below detail setting described above in Excel for Windows. Also check whether the rows you intended as a summary are actually above or below the selected detail range. On Mac or Excel for the web, the settings or ribbon placement may differ; if the setting is not available, keep the heading outside the selected detail rows and use the visible group controls to verify the result.
Rows will not group or ungroup. Look for worksheet protection, merged cells or an existing outline that overlaps the range. Try selecting the precise row numbers, expanding any existing groups, and removing a conflicting group before creating a new one. If the workbook is open in Excel for the web and the relevant command is missing, open it in the desktop app and make the outline change there.
Frequently Asked Questions
Can I group rows while keeping one row visible above them?
Yes. Put the heading in its own row, select only the rows beneath it, and group those rows. When you collapse the group, the ungrouped heading remains visible.
Does grouping rows hide them permanently?
No. Grouping creates a collapsible outline. Click the plus control or a higher outline level to show the hidden rows again. The data remains in the worksheet while the group is collapsed.
Can I group rows that are not next to each other?
Not as one continuous outline group. Group each separate block of adjacent rows on its own. This makes it possible to collapse one section without hiding unrelated rows between sections.
How do I remove a row group?
Select rows in the group, then choose Data > Ungroup. To remove every outline group on the worksheet, use Data > Ungroup > Clear Outline. These commands remove outline controls; they do not delete worksheet records.
Can I group rows that contain formulas or totals?
Yes. Grouping does not change a formula or calculate a total; it only controls whether rows are shown. Keep a total in a separate, ungrouped summary row if you want it to remain visible while the detail is collapsed.
Will grouping rows work in Excel for Mac or Excel for the web?
Excel for Mac includes row grouping, though ribbon placement and some outline settings may differ from Windows. Excel for the web may also provide basic grouping commands, depending on the available interface. If you cannot find a needed outline setting, use the desktop app and check that the heading stays visible after collapsing.
Related
- Excel Shortcut Keys Practice: Drills That Build Speed
- Excel Zoom Shortcuts: How to Zoom In and Out Quickly
- Excel Shortcut Keys for Switching Between Worksheets
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Header Drop-Downs: Add Filters or Choice ListsTo add a drop-down arrow for sorting or filtering, turn your data into an Excel table: select the…
- How to Insert a Leader Line in Microsoft WordTo add a dotted or dashed leader between text and a blank space in Word, set a tab…
- How to Pull Up Archived Emails in Microsoft OutlookTo pull up archived emails in Outlook, open the Archive folder in your mailbox, or search your mailbox…
- How to Double Space in Word (Microsoft 365)To double-space text in Word for Microsoft 365, select the text—or press Ctrl+A on Windows or Command+A on…
- Excel Day Today: Find Today’s Date and Day NumberToday is Monday, November 2, 2026. In Excel for Microsoft 365, enter =TODAY() in a cell to display…
- Google Sheets Filter Shortcut: Apply a Filter FastIn Google Sheets in a web browser, press Ctrl+Shift+L on Windows, Linux, or ChromeOS to create a filter;…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.