To manually group rows in Excel for Microsoft 365 on Windows, select the contiguous rows by their row numbers, then choose Data > Group > Group Rows (or Data > Group and choose Rows if Excel opens a dialog). Excel adds outline controls so you can collapse those rows without deleting their contents.
What grouping rows does
Grouping is Excel’s outline feature for temporarily folding detail out of view. After you group rows, a bracket appears beside the row headings, along with a minus button and level buttons. Click the minus button to hide the grouped rows; click the resulting plus button to show them again. The row numbers may skip while a group is collapsed, but the rows and their values remain in the worksheet.
A common use is a report with detail records followed by a subtotal. For example, a monthly sales sheet might have several transaction rows for each region and a total beneath each region. Group the transactions, leave the total visible, and collapse the detail when you want a shorter summary. Grouping changes how much of the sheet is displayed; it does not create a calculation, rearrange records, or make a permanent change to the data.
Prepare the rows before grouping
Decide which rows should disappear together and which should remain visible as context. In a summary report, select the detail rows but usually leave the subtotal or heading row outside the group. If you include the subtotal by mistake, it will be hidden along with the detail, so the collapsed view may no longer show the figure readers need.
Grouping works most predictably with one continuous block of rows. A heading row above the block and a total row below it are useful visual boundaries, but they are not required. If the worksheet contains blank rows, check whether they are intentional separators: including one means it will also be hidden when you collapse the group. Save the workbook before making a large set of outline changes if the structure is important.
- Identify the first and last detail rows.
- Keep summary labels and totals outside the group if they should stay visible.
- Check for blank or unrelated rows inside the selection.
- If the sheet is filtered, clear or account for the filter so you can see which rows you are selecting.
Group selected rows step by step
- Click the row number of the first row you want to group.
- Hold Shift and click the row number of the last row. The entire continuous range between them should be highlighted. You can also drag across the row numbers.
- On the ribbon, open the Data tab. In the Outline area, choose Group. If Excel presents a choice, select Rows and confirm.
- Look to the left of the row numbers for the outline bracket and minus control. Click the minus to collapse the group, or click the plus that appears to expand it.
Selecting row headings is a reliable way to make clear that the target is a whole-row outline. If you select cells instead, Excel may ask whether to group rows or columns. Choose Rows for a vertical group of worksheet records. On Excel for Mac, use the Data tab’s Group command; the ribbon layout can differ slightly from Windows, but the same row-selection principle applies. A common Mac shortcut for grouping is Option+Shift+Right Arrow; on Windows, use Alt+Shift+Right Arrow. Keyboard shortcuts can vary with keyboard layout and Excel settings, so the ribbon command is the dependable alternative.
Use outline levels and nested groups
Excel displays numbered outline-level buttons beside the sheet. Clicking a level shows that level of summary: the lowest level shows all detail, while a higher level hides more of the grouped detail. The exact number of levels depends on how many layers of groups the worksheet contains. These buttons are useful when a report has many groups and you want to collapse or expand them together rather than clicking each bracket individually.
You can create nested groups by grouping a smaller block within a larger block. For example, a budget worksheet could have several expense rows grouped under each department, then all department sections grouped under a company-wide summary. Create the inner groups first, then select the wider range and group it. The resulting outline lets readers move between line-item detail, department totals, and the overall summary. Keep the hierarchy logical: overlapping or poorly planned ranges can make the outline harder to navigate.
Excel can place summary rows above or below detail, depending on the worksheet’s outline settings and how the data is arranged. If you routinely build reports with totals above their detail, review the outline settings before grouping so the visible summary remains where readers expect it. The goal is not simply to hide rows, but to leave a useful, understandable summary at each collapsed level.
Group versus hide, filter, or sort
Manual grouping is not the same as hiding rows one at a time. Hidden rows have no outline bracket or level control, so it can be less obvious how to restore them. Grouping is also different from filtering: a filter shows or excludes records based on criteria such as a date or category, while a group is a manually chosen block that can be collapsed regardless of the values in it.
Sorting changes row order, and grouping does not. If you sort a report after creating groups, the relationship between the outline and the intended sections may not remain useful. For data that needs regular sorting and filtering, use a consistent table structure and consider whether a PivotTable or filter is a better way to produce summaries. For a hand-built report with stable sections, manual groups are often simpler and easier to control.
Grouping is also not automatic categorization. Selecting a set of rows and choosing Group does not tell Excel to group every row with the same department name, nor does it create subtotals. It only adds an outline around the selected range. If rows are added later, check whether they fall inside the intended group; do not assume Excel will extend every manually created outline in the way you expect.
Common problems and how to fix them
- The Group command is unavailable. Check that you selected worksheet rows or cells in a continuous range and that the sheet is not protected against structural changes. If a dialog appears, make sure Rows is selected rather than Columns.
- The wrong rows disappear. Expand the group, inspect the bracket endpoints, and regroup the correct contiguous range. Pay special attention to whether you selected the subtotal or heading row as well as the detail.
- The plus and minus controls are missing. The worksheet may have outline symbols turned off. In Excel for Windows, open File > Options > Advanced, find the display options for the worksheet, and enable Show outline symbols if an outline is applied. The setting is worksheet-specific.
- Some rows cannot be grouped together. Nonadjacent selections are not a single continuous outline block. Group each separate block independently, or reorganize the report so related rows are adjacent.
- The outline looks confusing after edits. Ungroup the affected range and create the outline again after checking row order. Do not use Clear Outline unless you intend to remove all outline groups from the worksheet.
To remove one group while keeping its rows and data, select the grouped rows and choose Data > Ungroup. On Windows, Alt+Shift+Left Arrow is the corresponding ungroup shortcut. If you want to remove every outline level and group on the sheet, use Data > Ungroup > Clear Outline where that command is available. Clearing an outline does not erase cell contents, but it removes the group controls, so use it only when you intend to discard the outline structure.
What happens to formulas and hidden rows
Collapsing a group hides rows from view; it does not remove their values from ordinary calculations. A formula such as SUM over a range generally includes values in rows that are hidden manually by an outline. This matters when a visible total seems larger than the values currently shown: the hidden detail may still be included, which is often exactly what a subtotal should do.
Functions such as SUBTOTAL can behave differently depending on their function number. For example, the 1–11 function-number versions generally include manually hidden rows, while the corresponding 101–111 versions exclude manually hidden rows. Filtering has its own behavior as well. If a report’s displayed total must change when rows are hidden or filtered, choose the calculation deliberately and test it with a small example rather than assuming that collapsing a group changes the formula’s inputs.
Frequently Asked Questions
Can I group nonadjacent rows together?
Not as one continuous outline group. Group each separate contiguous block individually, or rearrange the rows so the items you want to collapse are next to one another.
Does grouping delete or change the selected data?
No. Grouping adds outline controls and lets you hide or show the rows. It does not delete their contents or change their values.
How do I expand a group after collapsing it?
Click the plus sign next to the group bracket. You can also use the outline-level buttons to show more detail across the worksheet.
Can I group columns instead of rows?
Yes. Select the column letters you want to group, then choose Data > Group. If Excel asks which direction to use, choose Columns.
Why does my total still include collapsed rows?
Collapsing a group hides rows rather than removing them from calculations. Ordinary SUM formulas generally continue to include those values; use an appropriate SUBTOTAL function if the total should respond to hidden or filtered rows.
Related
- How to Hide Columns and Rows in Numbers on iPhone
- DAX Measure to Count Rows: COUNTROWS Explained
- LibreOffice Calc Sheet Protection: Setup, Limits, and Tips
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Make a Flowchart in Word: Step-by-Step GuideTo make a flowchart in Microsoft Word, choose Insert > Shapes, add shapes from the Flowchart section, label…
- Excel Date and Time Shortcuts: Insert Both InstantlyIn Excel for Microsoft 365 on Windows, press Ctrl+; to insert the current date, or Ctrl+Shift+; to insert…
- How to Find Duplicate Values in Excel: Step-by-StepTo find duplicate values in Excel, select the cells you want to check, then choose Home > Conditional…
- Out of Office in Outlook PWA: Set Automatic RepliesTo set an out-of-office message in Outlook PWA, open Settings, find Automatic replies, switch them on, write your…
- How to Double Space in Word for Mac: Steps and FixesTo double-space text in Word for Mac, select it and choose Home > Line and Paragraph Spacing >…
- Mail Merge in Word, Excel & Outlook: A Step-by-Step GuideTo mail merge in Word with an Excel list and Outlook, prepare a spreadsheet with one recipient per…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.