Excel Spreadsheet Grouping Rows: How to Create and Use It

How-to basics · Updated November 21, 2026

To group rows in Excel for Microsoft 365 on Windows, select the detail rows, then choose Data > Outline > Group and select Rows if Excel asks. Use the outline controls that appear beside the row numbers to collapse or expand the group; grouping hides detail temporarily without deleting it or changing its values.

What grouping rows means in Excel

Grouping creates an outline around selected worksheet rows. Excel adds controls along the left edge of the sheet so you can show a compact summary view or reveal the underlying detail when needed. For example, a monthly report might keep a quarter total visible while allowing its three monthly rows to be collapsed. The rows remain in the worksheet and can be expanded again.

Grouping is useful when a sheet has a clear hierarchy: yearly totals with quarterly details, departments with employee records, or project phases with task lists. It gives readers a way to move between a high-level view and a more detailed one without maintaining separate worksheets. It does not, by itself, calculate totals or decide which rows belong together. You choose the rows and create the groups.

After grouping, Excel usually displays outline symbols beside the row numbers, including plus or minus controls and numbered outline levels. The level buttons let you show different depths of detail across the sheet. A worksheet with one level of groups may have a summary-only view at level 1 and a more detailed view at level 2. The exact levels depend on how many nested groups the outline contains.

How to group rows step by step

  1. Arrange the worksheet so each set of detail rows is contiguous. If a summary row is part of the layout, place it consistently above or below the detail it summarizes.
  2. Select the rows to group. You can drag across their row numbers on the left, or select cells within the rows. For a single group, select only its detail rows rather than the summary row you want to remain visible.
  3. On the ribbon, choose Data > Outline > Group. If Excel opens a dialog asking whether to group Rows or Columns, choose Rows and select OK.
  4. Use the minus control beside the selected rows to collapse them. The control changes to a plus; select it to expand the rows again.

For example, if rows 5 through 7 contain January, February, and March figures and row 8 contains a quarterly total, select rows 5 through 7 and group them. Collapsing the group hides the three monthly entries while leaving row 8 visible. If the total is above the detail instead, set the outline option for summary rows above detail before creating groups, or arrange the data to match the existing outline setting.

On Windows, the keyboard shortcut Alt+Shift+Right Arrow groups the selected rows or columns, while Alt+Shift+Left Arrow ungroups them. The ribbon is a reliable alternative if the shortcut is intercepted by a keyboard layout or another application. Excel for Mac has different shortcut behavior; use the Data tab’s Group and Ungroup commands if the Windows shortcut does not apply. Excel for the web may present a different ribbon layout, so open the workbook in desktop Excel if an outline command is not available in the browser.

How outline controls and levels work

Excel’s outline controls are separate from the worksheet data. A minus sign means the group is currently expanded; selecting it collapses the rows. A plus sign means the group is collapsed; selecting it expands the rows. The numbered buttons at the top-left of an outlined sheet show increasing levels of detail. Selecting a level hides groups deeper than that level across the outline.

When symbols are missing, first check whether the outline is collapsed in a way that leaves the controls outside the visible area, or whether the worksheet is protected or displayed in a restricted environment. In Windows desktop Excel, Ctrl+8 toggles the display of outline symbols. This changes whether the controls are shown, not whether the groups or their data exist. If needed, use Data > Outline > Show Detail or the group commands to inspect the outline.

Groups can be nested. For instance, detail rows for each month can form a group, and several monthly groups can sit inside a larger group for a quarter. Collapsing the inner group hides its detail; collapsing the outer group hides all rows within that larger section. Plan the hierarchy before creating many groups, because a clear outline is easier to operate than a collection of overlapping groups with no visible summary structure.

Plan summary rows and report layout

A useful outline makes the rows that should stay visible easy to identify. Put summary figures outside the detail group, and use labels that explain what they summarize. A section called Quarter 1 Total is clearer than a number in an unlabeled row. If you want the summary above its detail, use Excel’s outline setting for summary rows above detail. On Windows, open the Data tab, then the Outline dialog box launcher, and adjust the summary-row setting before grouping.

For a simple manual outline, group one block of detail at a time. Suppose rows 2 through 13 hold twelve monthly records and row 14 holds the annual total. Group rows 2 through 13 if the annual total should remain visible when the detail is collapsed. For a department report, group each department’s employee rows separately and leave the department total outside each group. This makes it possible to collapse one department without hiding the others.

Consistent row structure matters. Blank separator rows can make it harder to select the correct ranges and can confuse readers about which records belong to a section. Grouping does not use labels or formulas to infer categories: selecting rows 5 through 10 groups exactly those rows, even if one of them is a heading or a total. Review the selection before applying the command, particularly in a long report.

Grouping versus automatic subtotals

Manual grouping and automatic subtotals are related but not identical. Grouping simply creates a collapsible outline around rows you select. It does not insert a total, count records, or add a formula. If you need Excel to calculate a subtotal at each change in a category, use Data > Subtotal on a properly sorted range. The Subtotal command can insert summary rows and create an outline automatically.

For example, a sales list sorted by region can use the Subtotal command to add a total for each region. If the goal is only to hide and show existing rows beneath totals already in the worksheet, manual grouping is usually more direct. The Subtotal command is designed for a range of data, and it may be unavailable when the data is formatted as an Excel table. In that case, use the table’s total row or appropriate formulas, or convert the table to a normal range if automatic subtotals are needed.

Do not confuse grouping with filtering. A filter hides rows that do not meet criteria, such as showing only one region. An outline hides rows because you collapse a chosen section, regardless of their values. You can use both in a worksheet, but they answer different questions: filters select records by conditions, while grouping provides a navigable hierarchy.

Ungroup rows and fix common problems

To remove a group, select its grouped rows and choose Data > Outline > Ungroup. If Excel asks whether to ungroup rows or columns, choose Rows. Ungrouping removes that outline level but leaves the worksheet contents unchanged. To remove all outline groups from the sheet, use Data > Outline > Ungroup and choose Clear Outline, where that command is available. Clearing an outline does not delete the underlying records or summary values.

  • The wrong rows disappear: Expand the group, inspect its boundaries, then select the intended detail rows and regroup. Avoid including a total row if it must remain visible.
  • The group is in the wrong direction: Check whether the summary row is above or below the detail and adjust the summary-row setting in Outline settings. The setting affects how Excel organizes the outline.
  • Only part of a section collapses: The selected range may not include every detail row, or nested groups may be controlling different parts of the section. Expand all levels and review the group boundaries.
  • Outline buttons are not visible: In Windows, press Ctrl+8 to toggle outline symbols. Also check that the worksheet is not protected in a way that prevents the needed changes.
  • A normal total changes unexpectedly: Collapsing a group does not remove its values. Ordinary calculations such as SUM still include values in hidden rows, so do not treat a collapsed view as a filtered calculation.

When rows are collapsed, some commands and selections can be less obvious because detail is hidden. Expand the outline before editing or deleting records if you need to verify exactly which rows are affected. Save a copy before making extensive structural changes to a report, especially if it contains formulas or a carefully arranged outline.

When grouping is the right choice

Use grouping when readers need repeatable access to both summary and detail views in the same worksheet. It works well for reports with stable sections, such as monthly detail under yearly totals or tasks under project phases. It is less suitable when users need to explore arbitrary categories, compare filtered subsets, or create summaries from frequently changing records. In those cases, filters, PivotTables, or a structured data table may be easier to maintain.

Grouping also does not protect sensitive information. Collapsing a group only changes what is displayed; it is not a security feature, and another user can expand the rows or inspect the workbook. If some data should not be shared, remove it from the distributed file or use appropriate access controls rather than hiding it in an outline.

For a polished shared report, test the outline from the reader’s perspective: collapse each level, check that the remaining labels and totals make sense, and confirm that important notes are not hidden with the detail. If the sheet will be printed, preview the page layout too. A group that looks tidy on screen may still produce an awkward printed page if the detail is expanded or split across pages.

Frequently Asked Questions

How do I group rows in Excel with a keyboard shortcut?

In Excel for Windows, select the rows and press Alt+Shift+Right Arrow to group them. Press Alt+Shift+Left Arrow to ungroup selected rows. On Mac, use Data > Group or Data > Ungroup if the Windows shortcut does not apply.

Can I group rows without hiding them?

Creating a group does not immediately delete or alter its detail, and an expanded group keeps its rows visible. Grouping adds controls so you can collapse or expand the rows when useful; the rows are hidden only while the group is collapsed.

Why does my total still include collapsed rows?

Collapsing an outline changes the display, not the data used by ordinary formulas. A SUM calculation still includes values in collapsed rows. If the calculation should respond to filtering or manually hidden rows, choose a suitable subtotal function and check its behavior for your worksheet.

Can I group columns as well as rows?

Yes. Select the columns to outline and choose Data > Outline > Group. If Excel asks, select Columns. Column groups use controls above the column letters and work on the same general outline principle.

How do I remove every group from a worksheet?

Use Data > Outline > Ungroup and choose Clear Outline, if shown. This removes the outline structure, not the rows, values, or summary calculations. If you only want to remove one group, select that group and use Ungroup instead.

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.