How to Group Excel Rows and Keep the Top Rows Visible

How-to basics · Updated November 3, 2026

How to Group Excel Rows and Keep the Top Rows Visible

To group rows in Excel and keep your headings visible, select the detail rows, choose Data > Group, then freeze the heading rows with View > Freeze Panes. Grouping lets you collapse and expand detail; freezing keeps the chosen rows at the top as you scroll. Set up the headings and row ranges first so the group contains only the detail you want to hide.

What You’ll Need

  • A workbook open in Microsoft Excel for Microsoft 365 on Windows. The ribbon paths below are for that version.
  • A sheet with a clear heading area and rows of detail underneath. For example, you might have a report title and column headings in rows 1 and 2, with monthly transactions starting in row 3.
  • Permission to edit the worksheet. If the sheet is protected, grouping or freezing settings may be unavailable until it is unprotected.

Step-by-Step

  1. Identify the rows to keep visible. Decide which rows form your heading area, such as a report title, column labels, or both. Excel’s Freeze Top Row command keeps only row 1 visible. If your headings occupy more than one row, use Freeze Panes instead, as described in step 5. Avoid including headings in the group you plan to collapse.
  2. Select the detail rows to group. Use the row numbers along the left edge of the worksheet. Click the number of the first detail row, then drag to the number of the last row you want in the group. For a report with headings in rows 1 and 2 and detail in rows 3 through 12, select row numbers 3 through 12. To select non-adjacent ranges, make separate groups rather than trying to include unrelated rows in one range.
  3. Group the selected rows. On the ribbon, choose Data > Group. If Excel displays a Group dialog because you selected cells rather than full row headers, choose Rows and confirm. Excel adds outline controls beside the row numbers. A bracket marks the grouped range, and a minus control indicates that its detail is currently expanded.
  4. Check the group before collapsing it. Look at the bracket and confirm that it spans the intended detail rows only. If you accidentally included a heading or a total that should remain visible, undo the action with Ctrl+Z on Windows, select the correct row range, and group again. If the group is correct, click its minus control to collapse the rows. Click the plus control later to show them again.
  5. Freeze a single top heading row, if that is all you need. Select View > Freeze Panes > Freeze Top Row. Row 1 will stay visible while you scroll down. This choice is convenient when row 1 contains the only heading you need, but it will not keep row 2 or any other lower row fixed.
  6. Freeze multiple heading rows when necessary. First make sure the sheet is scrolled to the top. Click the cell in column A directly below the last heading row. For example, if rows 1 and 2 are headings, select A3. Then choose View > Freeze Panes > Freeze Panes. Excel freezes every row above the selected cell; selecting A3 therefore keeps rows 1 and 2 visible. Selecting a cell in a later column also freezes columns to its left, so use column A if you do not want to lock columns.
  7. Test both behaviors together. Scroll down to confirm the frozen heading remains in view. Then click the group’s minus control and check that the detail rows collapse without removing the frozen heading. Expand the group with its plus control when you need to inspect the detail again. If you have several groups, test each one separately.
  8. Save the workbook. Save after you have checked the outline and freeze panes. These settings are stored with the worksheet, so the next person opening the workbook can use the groups and frozen headings too. If the sheet is one part of a shared report, tell collaborators which outline buttons expand the detail.

On Excel for Mac, the same general approach applies: select the row headers and use the Data tab’s Group command, then use the View tab’s freeze controls. Ribbon placement and labels can differ slightly by Excel release. In Excel for the web, grouping and freeze controls may be available in the ribbon, but the desktop app is a practical choice if a command is missing or the outline is difficult to manage.

Common Mistakes

Freezing the wrong number of rows: Freeze Top Row fixes row 1 only. If your headings are in rows 1 and 2, row 2 will scroll away when you use that command. Use Freeze Panes with the active cell immediately below the full heading area instead.

Selecting the heading as part of the group: If you group rows 2 through 12 when row 2 contains column labels, collapsing the group hides those labels. Select only the detail rows, such as rows 3 through 12. If a heading disappears, expand the group, undo the grouping, and recreate it with the corrected range.

Choosing the wrong Freeze Panes cell: Excel freezes rows above the active cell and columns to its left. Selecting C3 freezes rows 1 and 2, but it also freezes columns A and B. If you only want to keep two heading rows visible, select A3 before choosing Freeze Panes.

Expecting a group to hide data permanently: Grouping is a display control, not deletion. Collapsed rows are still in the worksheet and can still affect formulas, charts, or print layouts. Expand the outline whenever you need to review or edit the underlying records.

Grouping a whole table without checking totals: A subtotal or summary row may belong outside the detail group so it stays visible when the detail is collapsed. Decide whether totals should be shown with the collapsed report, then include or exclude those rows intentionally.

Confusing hidden rows with grouped rows: Manually hiding rows does not create the same outline controls. If you need a clear expand-and-collapse button, use Data > Group rather than the row context menu’s hide command.

Tips

Use one group per logical section, such as one group for each month or department. That makes it easier to collapse only the area a reader does not need. Select the relevant row numbers for each section and repeat Data > Group. Keep each section’s heading or subtotal outside its detail group if it should remain visible after collapse.

For a summary-first view, collapse the groups after creating them, then save the workbook. Readers can begin with the high-level information and expand a section only when they need its underlying rows. The outline level buttons, usually shown as numbered controls near the upper-left of the sheet, can display a broader level of detail across several groups at once.

To remove a group without deleting worksheet data, expand it if needed, select its row range, and choose Data > Ungroup. If you want to remove outline groups from the sheet, use the outline controls on the Data tab; do not select Delete unless you actually intend to remove the rows. To change the frozen area, choose View > Freeze Panes > Unfreeze Panes, then select the correct cell and freeze again.

Consider how the sheet will be viewed on a small screen. A tall frozen heading area takes up more of the visible window, leaving less room for records. Freeze only the rows readers need to interpret the data. If a report has a large title block, you may keep just the column-label row visible rather than freezing every introductory row.

Grouping and freezing solve different problems, so set them up independently. Groups control whether rows of detail are shown; Freeze Panes controls which rows or columns stay in place during scrolling. This distinction makes it easier to diagnose a sheet where collapsing works but the heading scrolls away, or where the heading stays put but the detail has no collapse control.

Troubleshooting

The Group command is unavailable: Check that you selected worksheet row headers or a valid range of rows, not a chart or shape. If the worksheet is protected, ask the workbook owner to unprotect it or allow outlining. Also check whether you are editing a shared or restricted workbook, since permissions and compatibility can limit structural changes.

The plus and minus controls are missing: The outline may be hidden even though the rows are grouped. In Windows Excel, open File > Options > Advanced, find the display options for the worksheet, and enable Show outline symbols if an outline is applied. If the controls still do not appear, expand the Data tab’s outline controls and review the grouping, or ungroup and recreate the range.

Collapsing hides too much or too little: Expand the group and inspect the bracket beside the row numbers. If the selection included extra rows, undo or ungroup it and make a new group over the exact range. For a complicated sheet, create smaller groups for separate sections instead of one broad group that is hard to manage.

The heading still scrolls away: Check whether you used Freeze Top Row when the heading is below row 1 or spans multiple rows. Unfreeze panes, select the cell immediately below the last heading row in column A, and choose View > Freeze Panes > Freeze Panes. Scroll to the top first so you can verify the intended boundary.

Unexpected columns are also frozen: The selected cell was likely not in column A. Choose View > Freeze Panes > Unfreeze Panes, select the cell below your headings in column A, and freeze again. Excel freezes the rows above and columns to the left of the active cell.

The outline changes after copying or inserting rows: Row insertions, deletions, and pasted content can affect group boundaries. Expand the groups and check the brackets after structural edits. Adjust the ranges or recreate the outline so the controls match the current layout.

Frequently Asked Questions

Can I keep two or more heading rows visible?
Yes. Scroll to the top, select a cell in column A directly below the final heading row, and choose View > Freeze Panes > Freeze Panes. For headings in rows 1 and 2, select A3 first.

Will the frozen heading stay visible when I collapse a group?
Yes. Freezing and grouping are separate worksheet settings. As long as the heading rows are not included in the group, they stay visible when you collapse detail rows.

Can I make several separate row groups?
Yes. Select and group each logical range separately, such as the detail rows for each month. You can expand or collapse each group individually. Nested groups are also possible, but check the outline levels so readers can tell which controls affect which rows.

Does grouping delete or change the values in the rows?
No. It hides the rows from the current view when collapsed; the values remain in the worksheet. Formulas and other features may still refer to those rows, so collapsing them should not be treated as removing their data.

How do I undo or remove Freeze Panes?
Choose View > Freeze Panes > Unfreeze Panes. This releases the frozen rows and columns but does not remove row groups. You can then choose a different freeze boundary.

Can I group rows and freeze headings in Excel for the web?
Many web versions provide grouping and freeze controls on the ribbon, but available commands can vary. If you cannot find the needed outline control, open the workbook in Excel for Microsoft 365 on Windows or Mac and set up the group there.

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.