To group rows in Excel, select the detail rows you want to collapse, go to Data > Group on the ribbon, and click Group again if prompted. Excel adds a collapsible outline bracket on the left margin. Click the minus sign to collapse, the plus sign to expand. No data is deleted.
- Key Takeaway 1: The keyboard shortcut to group rows in Excel is Shift + Alt + Right Arrow on Windows and Command + Shift + K on Mac.
- Key Takeaway 2: Excel groups rows below your header by default, but you can change this in Outline Settings so the summary row sits above the detail.
- Key Takeaway 3: Use the SUBTOTAL function, not SUM, to get accurate totals that respect collapsed groups.
- Key Takeaway 4: To group rows in Excel based on cell value, sort your data first, then use Data > Subtotal or Auto Outline to create groups automatically.
- Key Takeaway 5: Excel supports up to 8 nested outline levels in a single sheet, which covers virtually every financial or operational report structure.
How to Group Rows in Excel Manually
Manual grouping gives you precise control over which rows collapse together. This is the right approach when your data does not follow a clean repeating pattern — for example, when you are building a project report where each section has a different number of detail rows. Knowing how to group rows in Excel manually is the foundation before moving to automated methods.
Step-by-Step: How to Group Rows in Excel
- Open your spreadsheet and identify the detail rows you want to group. Do not include the header row or the summary row in your selection.
- Click the row number of the first detail row, hold Shift, and click the last row number in the group. Entire rows must be selected, not just individual cells.
- Go to the Data tab on the ribbon and click Group in the Outline section.
- If prompted, choose Rows and click OK.
- A bracket and minus sign (–) appear on the left margin. Click the minus sign to collapse the group and the plus sign (+) to expand it.
Numbered buttons (1, 2, 3) appear at the top-left corner of the row numbers. Button 1 collapses everything, button 2 shows one level of summary, and button 3 shows full detail. This outline level control is extremely useful when presenting a report to a manager who only wants the summary view.
A Practical Example
Say you are building a monthly MIS report for a retail chain with stores in Mumbai, Delhi and Bengaluru — a common task in India’s BFSI and e-commerce sectors. Each store has 10 rows of daily sales data. You would group rows 2 to 11 under Mumbai, rows 12 to 21 under Delhi, and so on. The manager sees three summary rows; you keep all the detail one click away. This is exactly the kind of structured reporting that NASSCOM’s 2024 India Tech Talent Report identifies as a top practical competency tested during MIS and analyst hiring in India.
One common mistake: selecting the header row or the summary row as part of your group. Excel will not error out, but those rows collapse too, which breaks the report layout. Always start your selection one row below the label and one row above the total.
Excel Group Rows Shortcut and Header Settings
The Excel group rows shortcut saves serious time when you are building multi-section reports. On Windows, select your rows first, then press Shift + Alt + Right Arrow. On Mac, use Command + Shift + K. To ungroup, press Shift + Alt + Left Arrow on Windows or Command + Shift + J on Mac. These shortcuts work on Excel 2013 and all later versions.
How to Group Rows in Excel with a Header Visible
By default, Excel places the collapse control below the grouped rows, so the summary row sits at the bottom of the group. Most report templates in India and globally use this layout because the total appears after the detail, just like a printed ledger.
If your summary row is at the top (above the detail rows), you need to change the outline direction. Go to Data > Outline (click the small arrow in the bottom-right of the Outline group) to open Outline Settings. Uncheck Summary rows below detail and click OK before you create your group. This tells Excel to put the collapse control above the detail, so your header or summary row stays visible when the group is collapsed.
To keep your actual column headers (row 1) visible while scrolling, use View > Freeze Panes > Freeze Top Row separately. Grouping and freezing are independent features. Confusing them is one of the most common errors beginners make when learning how to group rows in Excel with a header.
Quick Reference: Excel Group Rows Shortcuts
| Action | Windows Shortcut | Mac Shortcut |
|---|---|---|
| Group selected rows | Shift + Alt + Right Arrow | Command + Shift + K |
| Ungroup selected rows | Shift + Alt + Left Arrow | Command + Shift + J |
| Collapse to outline level 1 | Alt + 1 | Command + 1 |
| Expand to outline level 2 | Alt + 2 | Command + 2 |
| Remove all grouping | Alt + A + U + C | Data > Ungroup > Clear Outline |
How to Group Rows in Excel Based on Cell Value
Grouping rows in Excel based on cell value is a different process from manual grouping. You cannot select random rows and click Group when you want Excel to automatically detect repeating values like North, South, East or product categories. You need to sort first, then use the Subtotal or Auto Outline feature. This is one of the most searched variations of how to group rows in Excel, and it comes up regularly in analyst take-home assignments.
Method 1: Data > Subtotal (Recommended for Beginners)
- Sort your data by the column that holds the category value. For example, sort by Region (A to Z) so all North rows are together.
- Click any cell inside the data range.
- Go to Data > Subtotal.
- In the dialog, set At each change in to your category column (e.g., Region), choose a function like Sum or Count, and tick the columns to calculate.
- Click OK. Excel inserts subtotal rows automatically and groups the detail rows under each category.
This is the fastest way to group rows by cell value when your data is tabular and already sorted. The Subtotal dialog handles both the grouping and the formula work in one step.
Method 2: Auto Outline
If your sheet already has SUM or SUBTOTAL formulas that reference adjacent ranges, Excel can detect the structure automatically. Go to Data > Group > Auto Outline. Excel reads the formula dependencies and creates groups wherever it finds a pattern. This works well for pre-built financial templates but can produce unexpected results on messy data, so check the output carefully.
If you are preparing for a data analyst interview, expect questions about structuring and summarising datasets. Knowing how to group rows in Excel by value is a practical skill interviewers test with take-home assignments, not just theory questions.
How to Group Rows in Excel and Sum Them
This is where many people make a critical error. If you write a regular =SUM(B2:B11) formula in your summary row, it includes hidden (collapsed) rows in the total. That is technically correct, but it defeats the purpose of grouping when you want the collapsed view to show only the visible summary.
Use SUBTOTAL, Not SUM
The SUBTOTAL function ignores hidden rows when you use function numbers 101 to 111. For summing visible rows only, use:
=SUBTOTAL(109, B2:B11)
Function number 109 means SUM while ignoring manually hidden rows. Function number 9 sums including hidden rows. For grouped reports where rows are collapsed rather than manually hidden, both 9 and 109 give the same result, but using 109 is the safer habit because it handles all hiding scenarios consistently.
Excel Group Rows and Sum: A Worked Example
The table below shows a daily sales report for two cities. Figures are in Indian Rupees using lakh notation (1,35,500 = one lakh thirty-five thousand five hundred).
| Row | Description | Sales (INR) | Formula Used |
|---|---|---|---|
| 2 | Day 1 – Mumbai | 45,000 | (detail row) |
| 3 | Day 2 – Mumbai | 52,000 | (detail row) |
| 4 | Day 3 – Mumbai | 38,500 | (detail row) |
| 5 | Mumbai Total | 1,35,500 | =SUBTOTAL(109, C2:C4) |
| 6 | Day 1 – Delhi | 61,000 | (detail row) |
| 7 | Day 2 – Delhi | 47,200 | (detail row) |
| 8 | Delhi Total | 1,08,200 | =SUBTOTAL(109, C6:C7) |
When you collapse the Mumbai group, row 5 stays visible and shows 1,35,500. The manager reading the report sees clean totals, not raw data. This is what professional report-building looks like in practice.
According to Statista’s 2023 Global Software Usage Report, Microsoft Excel is used by over 750 million people worldwide, making it the most widely deployed spreadsheet application in enterprise and SMB settings globally. NASSCOM’s 2024 India Tech Talent Report found that spreadsheet proficiency, specifically data organisation and reporting skills, ranks among the top five practical competencies employers test during MIS and analyst hiring in India. LinkedIn’s Jobs on the Rise 2024 list placed Data Analyst roles in the top 10 fastest-growing positions in India, with Excel and data visualisation consistently listed as required skills in job postings.
If you want to understand where these spreadsheet skills fit in a broader career path, the comparison between data analyst vs data scientist roles is a good starting point. Analysts spend far more time in Excel and SQL than data scientists do, at least in early career roles.
Knowing how to group rows in Excel and produce clean summaries is also directly relevant to data analytics projects, where you often need to present aggregated findings to non-technical stakeholders without overwhelming them with raw data.
Excel is consistently listed among the highest-paying tech skills for entry-level roles when combined with SQL and data visualisation tools. It is also one of the core skills mentioned in entry-level tech jobs growing this year, particularly in operations, finance and analytics support roles.
If you are just starting your analytics journey and want a structured path, the guide on how to become a data analyst covers exactly which tools and certifications to prioritise at each stage.
Frequently Asked Questions
How do I group rows in Excel?
Select the rows you want to group by clicking their row numbers, go to Data > Group on the ribbon, and choose Rows if prompted. Excel adds a collapsible outline bracket on the left margin. Click the minus sign to collapse the group and the plus sign to expand it. Do not include your header or total row in the selection.
What is the shortcut to group rows in Excel?
On Windows, select the rows first and press Shift + Alt + Right Arrow to group them. On Mac, the shortcut is Command + Shift + K. To ungroup, use Shift + Alt + Left Arrow on Windows or Command + Shift + J on Mac. These shortcuts work on any version of Excel from 2013 onwards.
How do I group rows in Excel with a header?
Make sure your header row is not included in the rows you select before grouping. To keep the summary row above the detail rather than below, go to Data > Outline Settings and uncheck Summary rows below detail before creating the group. For column headers that stay visible while scrolling, use View > Freeze Panes > Freeze Top Row separately.
How do I group rows and sum them in Excel?
Place a =SUBTOTAL(109, range) formula in your summary row, where the range covers the detail rows in that group. Function number 109 sums values while ignoring hidden or collapsed rows. Avoid using a plain SUM formula for grouped reports because SUM includes hidden rows in its calculation, which can mislead anyone reading only the collapsed view.
How do I group rows in Excel based on cell value?
Sort your data by the category column first (for example, sort by Region A to Z so all matching values are together). Then go to Data > Subtotal, set At each change in to your category column, choose your summary function (Sum, Count, etc.) and click OK. Excel inserts subtotal rows and groups the detail rows under each unique value automatically.
The core skill here is simple: select the right rows, use the right shortcut, and write SUBTOTAL instead of SUM. Master those three things and you can build clean, collapsible reports in any Excel sheet in under five minutes. Here are three things you can do this week to put it into practice:
- Open any flat data table you already have (sales figures, attendance records, expense logs) and practice grouping rows manually using the Shift + Alt + Right Arrow shortcut. Collapse and expand a few groups until the outline controls feel natural.
- Try the Data > Subtotal feature on a sorted dataset with a repeating category column. Compare what it produces with your manual groups and notice how SUBTOTAL handles the formula automatically.
- Explore a structured learning path. If you are serious about building data skills that transfer into real roles, check out the full range of 3.0 University online certification courses. Data organisation skills like Excel grouping also apply in security analytics, where analysts filter event logs and build incident dashboards daily. The EC-Council Certified SOC Analyst course at 3.0 University is a practical next step if you want to apply analytical skills in a cybersecurity career.
Last updated: June 2025. Reviewed by the 3University editorial team.