Yes. In Excel for Microsoft 365 on Windows, keep the header row outside the group, select the detail rows beneath it, then choose Data > Group > Group. The header remains visible when you collapse the group, while the rows of detail can be hidden and shown with the outline controls.
What grouping rows with a header means
Excel’s row grouping is an outline feature: it adds controls beside the worksheet so you can temporarily hide or reveal related rows. It does not combine cells, merge records, or turn the header into a special kind of row. The header is simply an ungrouped row that labels the information below it.
For example, a monthly report might have a row labelled “January” followed by ten rows of transactions. Leave the January label row outside the group and group only the ten transaction rows. When you collapse the group, the transactions disappear but the January label stays on screen. Expand it again to inspect the detail.
This distinction matters because Excel hides every row included in a collapsed group. If you include the header in the selection, the header will be hidden too. Grouping is also different from filtering: a filter shows or hides records according to criteria, while an outline group is a manual, collapsible section.
How to group rows while keeping the header visible
On Windows, use the row numbers at the left of the worksheet to select whole rows. Selecting by row number makes it clear which rows belong to the group and reduces the risk of leaving part of a row outside the outline.
- Put a clear label in a row above the detail, such as “January” or “Department A.”
- Select the row numbers for the detail only. If the header is in row 4 and the details are in rows 5 through 12, select rows 5 to 12—not row 4.
- On the ribbon, choose Data > Group > Group. If Excel asks whether to group Rows or Columns, choose Rows.
- Look for the outline bracket and the minus button beside the selected rows. Click the minus button to collapse the detail; click the plus button to show it again.
For a quick keyboard method in Windows, select the detail rows and press Alt+Shift+Right Arrow to group them. Alt+Shift+Left Arrow ungroups a selected group. On a Mac, use the Data tab’s Group and Ungroup commands rather than assuming the Windows shortcuts apply; shortcuts can differ by Excel version and keyboard settings.
If the header row is below the detail rather than above it, the same basic rule applies: keep the header outside the selected range. The position of the label does not determine which rows Excel hides; the selection does.
Choosing where the header and summary row go
A header identifies what a section contains, while a summary row reports a total or other result. They can be the same row, but they do not have to be. A label such as “Quarter 1” can sit above the detail, with a total row after the detail. When the group is collapsed, Excel may leave the total visible if that total row is outside the group.
For reports where totals should appear above their detail, Excel has an outline setting. On Windows, open the Data tab, find the Outline group, and click its small dialog box launcher to open Outline Settings. Clear “Summary rows below detail” if you want summary rows above the detail; leave it selected when summaries belong below. This setting affects how Excel treats summary rows in outlines and subtotals, so check the result on a copy or sample before applying it to a large report.
A practical layout for a manually grouped report is:
- A section label or summary row that stays visible.
- One or more rows of detail grouped beneath it.
- Optionally, a separate total row that remains outside the group.
Keep labels descriptive. “West Region — 18 orders” tells a reader more than “Group 1,” especially when several sections are collapsed. Avoid placing unrelated notes or the next section’s header among the rows you plan to hide.
Working with nested groups and outline levels
Groups can be nested to show more than one level of detail. Suppose a worksheet has a row for each region, rows for each store within that region, and transaction rows within each store. You can group transactions into store sections, then group the store sections into a regional section. Collapsing a smaller group hides its transaction detail; collapsing the larger group hides the entire region’s detail.
Excel displays outline level buttons, usually numbered 1, 2, and 3, near the upper-left of the sheet. Clicking a number shows that level of summary. The exact number of levels depends on the outline’s nesting. The plus and minus controls expand or collapse individual groups. If the controls are missing, check whether outline symbols are enabled in Excel’s options, and make sure the worksheet is not hiding them through its display settings.
Build nested groups from the most detailed rows outward. First group the smallest detail blocks, then group the larger sections containing them. Before grouping, make sure each intended section has a consistent structure; otherwise, it is easy to include a neighbouring section’s label or leave stray rows outside the outline.
Examples for reports and working spreadsheets
For a sales report, use one row per salesperson under a visible “North” heading. Group the salesperson rows, leaving the North heading and any regional total outside the group. Repeat the layout for South and West. A manager can then collapse regions not needed for a quick overview without deleting the underlying figures.
For a project plan, a task heading can stay visible while the task’s substeps are grouped below it. This makes a long plan easier to scan. For a budget worksheet, a category label such as “Travel” can remain visible while individual expense lines are hidden. In each case, grouping changes only what is shown on screen; it does not remove the hidden rows or change their values.
Grouping is useful for a report that is reviewed at different levels of detail. It is less appropriate when readers need to search or filter records by fields, or when the rows have no natural section structure. In those situations, a properly arranged data table and filters may be more useful.
Common problems and how to fix them
- The header disappears when I collapse the group. The header row was probably included in the grouped selection. Expand the group, select the detail rows alone, and use Data > Ungroup before creating the corrected group.
- The plus and minus controls do not appear. Confirm that rows were grouped, not columns, and check that outline symbols are displayed. If the worksheet is protected, protection settings may prevent outlining actions; review the sheet protection settings or ask the workbook owner.
- Excel groups the wrong direction. If the selection contains cells rather than whole row numbers, Excel may infer a different grouping direction. Select the row labels, then use Data > Group and choose Rows if prompted.
- Rows are hidden but there is no clear label. Add a meaningful heading or summary outside the group. A collapsed outline can otherwise look like missing data to someone who did not create the worksheet.
- The group hides a subtotal I want to keep visible. The subtotal may be inside the group. Ungroup and recreate the range so the subtotal is outside, or adjust the summary-row placement and outline settings to match the report layout.
Before changing a complex outline, expand all groups and inspect the row boundaries. If the group structure is confusing or has become inconsistent after many edits, ungroup the affected rows and rebuild the outline in deliberate sections. Ungrouping does not delete the data, but it does remove the grouping controls.
Grouping versus tables, filters, and hiding rows
These tools solve different problems. An outline group is best when a worksheet has stable sections that readers should be able to fold away. Filters are better for selecting records that meet conditions, such as showing only orders from one customer or dates in a chosen period. Excel tables provide structured data management features, including filter buttons and consistent column headers; they are not the same thing as outline groups.
Manually hiding rows is another option, but it lacks the same clear group brackets and one-click outline levels. It can work for a temporary change, but a reader may not know that rows are hidden. Grouping makes the relationship between a visible section and its hidden detail easier to recognize. None of these options is a substitute for deleting data: collapsed and hidden rows remain in the workbook.
For data that needs regular sorting, filtering, or analysis, keep one record per row and one field per column, with a single header row. Use groups in a separate report or presentation view if readers need expandable summaries. Mixing outline groups into a dataset that people routinely sort can make the worksheet harder to navigate, so explain the layout and test common workflows.
Frequently Asked Questions
Should the header row be included when I group rows in Excel?
Usually not. Keep the header outside the group so it stays visible when the detail collapses. Include it only if you deliberately want the label to disappear with those rows.
Can I group rows without hiding the header?
Yes. Select only the rows beneath or beside the header that contain the detail, then use Data > Group > Group. The header remains visible because it is not part of the grouped range.
Can I group rows that already have a total row?
Yes. Decide whether the total should remain visible when the detail is collapsed. If so, leave the total row outside the group; if not, include it in the grouped range. Check the outline after collapsing it.
How do I remove a row group?
Select the grouped rows and choose Data > Ungroup > Ungroup, then choose Rows if Excel asks. This removes the outline grouping, not the row contents. To remove all outline groups on a sheet, use Data > Ungroup > Clear Outline carefully, because it clears the sheet’s outline structure.
Does grouping delete or change the hidden data?
No. Grouping only collapses rows from view. Their contents remain in the worksheet and can be displayed again by expanding the group. Remember that hidden rows may still affect calculations, printing, or review, depending on the formula or task.
Related
- Excel Shortcut Mouse Pad: What to Look For
- Excel Shortcut to Move Between Tabs: Windows and Mac
- Workbook Almost Too Large? How to Shrink an Excel File
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Shortcut to Go to a Named RangeIn Excel for Microsoft 365 on Windows, press Ctrl+G or F5 to open the Go To dialog, select…
- Import CSV to Outlook: Contacts, Steps, and TroubleshootingYes. To import a CSV contact list into Outlook, open People or Contacts and choose Manage contacts >…
- Compare Two Columns in Excel for DifferencesTo compare two Excel columns row by row, put a comparison formula in a third column and fill…
- How to Lock Specific Cells in Google Sheets for EditingTo lock specific cells in Google Sheets, select the cells, open Data > Protect sheets and ranges, add…
- Excel Keyboard Shortcut to Split a CellIn Excel for Microsoft 365 on Windows, press Alt, H, M, U to unmerge a selected merged cell.…
- Google Sheets: Get a Percentage of a NumberTo get a percentage of a number in Google Sheets, multiply the number by the percentage: if A1…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.