Most Excel trainers tell you to pivot every time you see duplicate names or categories. They’re wrong. PivotTables are overkill if you just need to collapse rows with identical entries in column A—especially when your data changes daily, you’re sharing with non-technical colleagues, or you’re working on a 12-year-old laptop with 4GB RAM. We’ve all sat through that 30-second pivot refresh while the coffee gets cold.
The Problem
You’ve pasted raw sales data into Excel. Column A has sales rep names, but they’re scattered—not sorted, not grouped, and definitely not collapsible. You want to quickly see all orders from 'Sarah Chen' together, then 'Diego Morales', then 'Priya Kapoor'—and fold them up like an accordion. Right now? You can’t. You click and drag, copy-paste manually, or worse: you sort, then eyeball where each name starts and ends. That’s fragile. One misplaced row breaks it.
| A1: Rep Name | B1: Product | C1: Amount | D1: Date |
|---|---|---|---|
| Sarah Chen | CloudSync Pro | $12,450 | 2024-02-11 |
| Diego Morales | DataShield Lite | $3,890 | 2024-02-14 |
| Sarah Chen | CloudSync Pro | $9,200 | 2024-02-18 |
| Priya Kapoor | APIFlow Starter | $5,100 | 2024-02-20 |
| Diego Morales | DataShield Lite | $14,600 | 2024-02-22 |
| Sarah Chen | CloudSync Pro | $7,320 | 2024-02-25 |
| Priya Kapoor | APIFlow Starter | $11,950 | 2024-02-27 |
| Diego Morales | DataShield Pro | $22,100 | 2024-03-01 |
| Sarah Chen | CloudSync Pro | $15,780 | 2024-03-03 |
Notice how Sarah appears four times—but not consecutively? That’s why sorting alone won’t help. And no, AutoFilter doesn’t let you collapse rows. You need structure—not just visibility.
The Solution
This isn’t about summarizing totals (that’s PivotTable territory). It’s about visual grouping: folding/unfolding blocks of identical values. Here’s what works—and it takes under 90 seconds:
- Sort by the column you want to group — Select A1:D10, then press Alt + A + S + S. Choose ‘Rep Name’ → ‘Ascending’. Now all Sarahs sit together, then all Diegos, then all Priyas.
- Select the entire data range — Click A1, then hold Ctrl + Shift + End. That selects everything down to the last used cell (D10 in our case).
- Apply Subtotal — Go to Data tab → Subtotal. In the dialog box:
- At each change in: Rep Name
- Use function: Count (yes, count—not sum!)
- Add subtotal to: Rep Name only
- Uncheck ‘Replace current subtotals’ and ‘Summary below data’
- Toggle outline levels — Look at the left edge. You’ll see numbers 1, 2, 3. Click 2. Instantly, each rep’s block collapses into one row showing their name and count (e.g., “Sarah Chen (4)”)
That’s it. No formulas. No macros. Just native Excel behavior hiding in plain sight.
| A1: Rep Name | B1: Product | C1: Amount | D1: Date |
|---|---|---|---|
| Sarah Chen (4) | — | — | — |
| Sarah Chen | CloudSync Pro | $12,450 | 2024-02-11 |
| Sarah Chen | CloudSync Pro | $9,200 | 2024-02-18 |
| Sarah Chen | CloudSync Pro | $7,320 | 2024-02-25 |
| Sarah Chen | CloudSync Pro | $15,780 | 2024-03-03 |
| Diego Morales (3) | — | — | — |
| Diego Morales | DataShield Lite | $3,890 | 2024-02-14 |
| Diego Morales | DataShield Lite | $14,600 | 2024-02-22 |
| Diego Morales | DataShield Pro | $22,100 | 2024-03-01 |
| Priya Kapoor (2) | — | — | — |
| Priya Kapoor | APIFlow Starter | $5,100 | 2024-02-20 |
| Priya Kapoor | APIFlow Starter | $11,950 | 2024-02-27 |
Surprise tip: If you double-click the gray bar between rows (e.g., between row 5 and 6), Excel auto-collapses *only* that group. Try it. You’ll feel like you cracked a secret.
Going Further
You can layer this technique. Want to group by rep *and* product? Sort first by Rep Name, then by Product (use Custom Sort with two levels). Then run Subtotal twice: once for Rep Name, then again for Product—with ‘Replace current subtotals’ unchecked both times. You’ll get nested outlines: level 1 = reps, level 2 = products within each rep.
Need totals? Change the Subtotal function from Count to Sum—and pick the Amount column (C1:C10). But be careful: if you use Sum *and* Count on the same field, Excel stacks them awkwardly. Better to add a helper column: in E2, type =IF(A2<>A1,1,0), drag down, then subtotal on column E using Sum. That gives clean counts without clutter.
And yes—you *can* group text, dates, or numbers. Just make sure the column is formatted consistently. A date stored as text (“02/11/2024”) won’t group with a real date (45345). Check with =ISNUMBER(A2).
When NOT to Use This
This method fails silently in three cases:
- Your data has blank rows — Subtotal treats each blank row as a new group boundary. Delete blanks before applying.
- You’re using Tables (Ctrl+T) — Subtotal doesn’t work inside structured tables. Convert back to a range first (Design tab → Convert to Range).
- You need dynamic grouping across sheets — This is static per worksheet. For live cross-sheet grouping, use Power Query (Get & Transform) instead—it’s heavier, but built for this.
Also: don’t use this if your list exceeds 100,000 rows. Subtotal recalculates slowly on huge datasets. PivotTables or FILTER() with UNIQUE() scale better there.
Keyboard Shortcuts
| Action | Shortcut | Notes |
|---|---|---|
| Open Sort dialog | Alt + A + S + S | Fastest way to sort without touching the mouse |
| Select current data region | Ctrl + Shift + 8 | Same as Ctrl+A, but stops at blank rows/columns |
| Collapse all groups | Alt + A + J + 1 | Level 1 = show only subtotals; Level 2 = show groups + details |
| Remove subtotals | Alt + A + J + R | Don’t try to delete subtotal rows manually—they’ll reappear |