Can You Group Rows in Excel? Steps and Tips

How-to basics · Updated November 18, 2026

Yes. In Excel for Microsoft 365 on Windows, select the detail rows you want to fold away, then choose Data > Group and select Rows if Excel asks. Grouping hides and reveals those rows with outline controls; it does not delete their contents or calculate a total.

What grouping rows means

Grouping is Excel’s outline feature for organizing a worksheet into sections. After you group a set of adjacent rows, Excel adds controls beside the row numbers: a minus sign to collapse the group and a plus sign to expand it. It also displays outline-level buttons, usually numbered 1, 2, and so on. These let you show a broad summary view or open more detail across the sheet.

For example, a monthly report might have one row for each transaction followed by a monthly total. You can group the transaction rows while leaving the total visible. A reader can collapse the transactions to scan the totals, then expand a month to inspect its entries. The underlying values remain in their original cells, so formulas that refer to them generally continue to work while the rows are collapsed.

Grouping is different from deleting rows, filtering records, or combining cells. It changes which rows are displayed, not the data itself. It is also distinct from grouping items inside a PivotTable, which is a separate feature for organizing categories such as dates or numeric ranges.

When row groups are useful

Row groups are most useful when a worksheet contains detail that readers need occasionally but do not need to see all the time. They create a compact view without requiring separate worksheets or permanently removing information. Common examples include:

  • Hiding daily transactions beneath a weekly or monthly summary.
  • Collapsing task-level steps under project phases or major milestones.
  • Keeping supporting calculations under a report line while leaving key results visible.
  • Folding optional assumptions or explanatory rows in a planning worksheet.

Grouping is less helpful when the main need is to show only records matching a condition, such as orders from one customer. Use a filter for that. A filter chooses which records meet criteria; a group gives a section a manual expand-and-collapse control. You can use both in the same worksheet, but their purposes are different.

How to group rows in Excel for Windows

For a straightforward outline, keep the summary row outside the group and select only the detail rows. For instance, if rows 5 through 10 contain individual expenses and row 11 contains the total, group rows 5 through 10 so the total can remain visible when the details are collapsed.

  1. Click the row number of the first detail row, then drag down the row headers to select the rest of the contiguous detail rows. You can also click the first row number, hold Shift, and click the last one.
  2. Open the Data tab on the ribbon and choose Group in the Outline area.
  3. If Excel displays a Group dialog, choose Rows and select OK. If it groups immediately, the selected row headers identify the rows being outlined.
  4. Use the minus control beside the row numbers to collapse the section. Click the plus control to show it again.

You can also select cells in the rows rather than their row headers, but choosing whole row headers makes the intended selection clearer. If Excel offers a choice between rows and columns, check that Rows is selected. The keyboard shortcut in Windows Excel to group the selected rows is Alt+Shift+Right Arrow; Alt+Shift+Left Arrow ungroups them. Ribbon commands are easier to remember and are a good option if a shortcut conflicts with another keyboard or system setting.

Make nested groups and choose what stays visible

You can group smaller sections inside a larger section to build levels. Suppose rows 5–16 contain three months of daily entries, with a subtotal row after each month. Group each month’s detail rows separately, then group the full range of monthly sections if you want one control for the quarter. Excel’s outline buttons let you move between levels: a higher-level view shows less detail, while a lower-level view opens more of the outline.

Plan the row layout before grouping. A useful pattern is to place a summary row just outside its detail rows, so the summary remains visible when the detail is collapsed. Excel’s default outline setting places summary rows below detail. In desktop Excel, you can review the outline options from the Data tab by opening the dialog box launcher in the Outline group. The setting named Summary rows below detail controls that placement. If your summaries are above the detail, adjust the setting before creating or revising the outline so the controls behave as expected.

Excel supports multiple outline levels, but a complicated outline can be hard to navigate. Use levels that match meaningful sections rather than grouping every small block several times. A reader should be able to understand what a collapsed section represents from the visible labels and totals.

Collapse, expand, and remove a group

Click the minus sign to collapse one group; its rows are hidden from view, and the control changes to a plus sign. Click the plus sign to expand it. The numbered outline buttons collapse or expand groups to a particular level across the outlined area. For example, if level 1 represents annual totals and level 2 represents monthly detail, selecting level 1 shows the broadest view, while selecting level 2 reveals the next level. The exact levels depend on how the outline was built.

To remove a group without deleting any worksheet data, select the rows in that group and choose Data > Ungroup. If Excel asks whether to ungroup rows or columns, choose Rows. Ungrouping removes the outline relationship; it does not restore or erase cell contents because grouping did not change them in the first place.

If the worksheet has many unwanted outline controls, use Data > Ungroup > Clear Outline in desktop Excel to remove the outline structure. This is broader than ungrouping one section, so use it only when you want to clear the worksheet’s groups. Hidden rows may remain hidden for other reasons, so check the row numbers and use the relevant unhide command if necessary.

Grouping compared with hiding, filters, and Subtotal

Manually hiding rows can produce a similar appearance, but it does not give you the same organized outline controls or level buttons. Use grouping when people should be able to open and close a named section repeatedly. Use simple hiding for a short-lived display adjustment where outline levels are unnecessary.

Filters are better for exploring changing sets of records. If a table has hundreds of orders, filtering by region or status shows rows that match a condition and excludes the rest. A group, by contrast, is based on a selected range of rows; it does not automatically identify records that meet a rule. If new rows are added later, you may need to adjust the group or table structure.

Excel’s Subtotal command is another related option for suitable lists. It can insert subtotal rows at changes in a chosen field and create an outline around the resulting details. This is not the same as manually grouping rows, and it works best with a list sorted by the field used for the subtotals. For a custom report layout or a table that should not receive inserted subtotal rows, manual grouping is often the more controlled choice.

Common problems and how to fix them

  • The plus and minus controls are missing: Check whether rows are already grouped and collapsed, whether outline symbols are hidden in Excel’s options, or whether the window is too narrow to show the controls. In desktop Excel, outline symbols can be shown or hidden through Excel Options under the advanced display settings for the worksheet. The wording and location can differ slightly by platform.
  • Excel grouped columns instead of rows: Undo the action if it just happened, select the row headers, and run Data > Group again. If the dialog appears, select Rows.
  • The summary disappears when you collapse: The summary row may be inside the selected group. Ungroup the range and create it again using only the detail rows, leaving the summary row outside the selection.
  • The outline shows unexpected sections: Check for existing groups or a previous outline. Ungroup the affected rows, or clear the outline if you intend to rebuild it from scratch. Also confirm that you selected the correct row numbers; selecting a blank row or a subtotal row can change what gets hidden.
  • Some rows cannot be grouped or the command is unavailable: Check whether the sheet is protected, the workbook is in a restricted editing state, or the selection includes a layout that Excel cannot group as intended. Try selecting a simple, contiguous range of row headers in an editable worksheet.

Before collapsing a large report, make sure the visible summary labels are clear. A collapsed group can conceal useful context, and it is easy for another person to mistake hidden detail for missing data. A small note such as “Expand for transaction detail” can make a shared worksheet easier to interpret.

Excel for Mac and Excel for the web

In Excel for Mac, the basic approach is similar: select the row headers and use Data > Group, then choose rows if prompted. Ribbon layout and some dialog options can differ from Windows, so use the visible Data-tab controls if a Windows-specific dialog description does not match your screen. Shortcuts also differ across Mac keyboards and Excel settings; the ribbon command avoids relying on a Windows shortcut.

Excel for the web has a more compact ribbon and feature availability can depend on the workbook and current version. Look on the Data tab for grouping or outline controls. If you cannot create or manage the outline in the browser, open the workbook in the desktop app and make the change there. When a workbook is shared, other people may be able to expand or collapse groups, but editing permissions and sheet protection still affect what they can change.

Frequently Asked Questions

Can I group rows in Excel without hiding data?
Yes. Grouping only collapses rows from view; it does not delete their contents. Expand the group with its plus control to display the rows again.

Can I group non-adjacent rows together?
Excel’s outline groups are intended for contiguous sections of rows. For separated records, use filters or organize the data into adjacent sections rather than expecting one outline control to gather scattered rows.

Can I group rows that contain formulas?
Yes. A formula does not prevent its row from being grouped. The formula remains in the worksheet while the row is collapsed, although you will not see the formula cell until you expand the group.

Does grouping rows automatically add a total?
No. Grouping only creates controls to hide or show the selected rows. Add a total or subtotal separately with a formula, a PivotTable, or a suitable subtotal feature.

Can I group rows in an Excel table?
Grouping is a worksheet outline feature, not a table command. You can often group worksheet rows that contain a table, but table expansion, filters, or the sheet’s layout can affect the result. If the command is unavailable, try grouping the relevant worksheet row headers outside the table’s header area or use a filter to focus the table.

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.