Quick Answer
Aggregating in Excel means collapsing rows of data into summary values—totals, counts, averages, min/max—and you do it best by matching the method to your data’s shape, stability, and audience. Don’t default to SUMIFS when a PivotTable updates itself when new rows arrive.All the Methods
| Method | Steps | Best For | Limitations |
|---|---|---|---|
| SUM / AVERAGE / COUNT | Type =SUM(B2:B50) manually | Static, clean ranges; quick one-offs | Breaks if rows inserted/deleted; ignores filters |
| SUBTOTAL | =SUBTOTAL(9,B2:B50); 9 = SUM, 109 = SUM ignoring hidden rows | Filtered lists, collapsible outlines | Only works on visible cells; confusing function numbers |
| PivotTable | Select data → Insert → PivotTable → Drag fields to Rows/Values | Exploratory analysis, cross-tab summaries, recurring reports | Requires clean source layout; refresh needed after source changes |
| SUMIFS / COUNTIFS | =SUMIFS(C2:C100,A2:A100,"Acme Corp",D2:D100,">=2024-01-01") | Conditional rollups (by dept, date range, status) | Slow on >50k rows; hard to audit; volatile with full-column refs |
| AGGREGATE | =AGGREGATE(9,3,B2:B50) — 9=SUM, 3=ignore errors+hidden rows | Messy data (errors, filters, subtotals already present) | Function numbers aren’t intuitive; no built-in UI |
| Dynamic Arrays (SUMBYGROUP) | =SUMBYGROUP(A2:A100,B2:B100) — requires Excel 365, Beta channel | Live grouped totals that spill & auto-update | Not available in Excel 2021 or LTSC; still experimental |
| Power Query Group By | Data → Get Data → Transform → Group By → Choose operation | Large datasets, repeatable ETL, multi-step logic | Overkill for 20-row tables; learning curve steep |
Method 1 Deep Dive
Let’s say you’ve got sales data in A1:E12:- A1 = "Rep", B1 = "Region", C1 = "Date", D1 = "Product", E1 = "Amount"
- A2 = "Sarah Chen", B2 = "APAC", C2 = "2024-03-15", D2 = "Cloud Storage", E2 = "$12,450"
- A3 = "Diego Morales", B3 = "EMEA", C3 = "2024-03-16", D3 = "API Access", E3 = "$8,920"
- … down to A12 = "Maya Patel", E12 = "$15,700"
Type =SUBTOTAL(9,E2:E12) in cell G2. That 9 tells Excel “use SUM” — but crucially, it only sums visible rows. Filter Region to show only APAC, and G2 instantly drops from $127,340 to $49,210. Try the same with plain =SUM(E2:E12) — it stays at $127,340. That’s why we use SUBTOTAL for dashboards with slicers or AutoFilter. Pro tip: Press Alt + ↓, then S to open the Subtotal dialog — it inserts outline groups *and* SUBTOTAL formulas automatically (but only if your data is sorted by the grouping column first).
Method 2 Deep Dive
Now imagine this same data grows to 2,400 rows across 17 products and 5 regions — and your finance team needs monthly totals by rep, by product, and trend charts. PivotTables are your anchor.Select A1:E2400 → Insert → PivotTable → OK. In the Field List, drag "Rep" to Rows, "Product" to Columns, and "Amount" to Values. Right-click any value → "Value Field Settings" → choose "Sum" (default), then click "Number Format" → Currency. Done. But here’s what most people miss: right-click the Date field → "Group" → check "Months" and "Years". Now you get a clean hierarchy: Years → Months → Reps. And if you add new rows to your source table tomorrow? Just right-click the PivotTable → "Refresh" (Alt + F5). No formula edits. No broken references. (Trust me, I learned this the hard way rebuilding SUMIFS every Monday for six months.)
One counterintuitive move: don’t put all your fields in the PivotTable at once. Start with just Rep and Amount. Then add Region. Then Product. Watch how the layout reflows — that’s your signal whether your data has duplicates or blank headers. If the PivotTable shows "(blank)" in the Rep row, go back and fix missing names in column A before proceeding.
Cheat Sheet
| Task | Formula / Action | Shortcut | Notes |
|---|---|---|---|
| Sum visible cells only | =SUBTOTAL(9,E2:E1000) |
Alt+↓, S | Use 109 instead of 9 to ignore manually hidden rows too |
| Aggregate with conditions | =SUMIFS(E2:E1000,B2:B1000,"APAC",C2:C1000,">=2024-01-01") |
None | Always lock ranges with $ if copying: $E$2:$E$1000 |
| Build a PivotTable | Select data → Insert → PivotTable | Alt+N+V | After creation, press Alt+J+T+R to refresh |
| Ignore errors + hidden rows | =AGGREGATE(9,7,E2:E1000) |
None | 7 = ignore errors, hidden rows, nested SUBTOTALs |
| Group & sum in Power Query | Data → From Table/Range → Transform → Group By → Operation: Sum | Ctrl+Alt+T | Outputs a new table — won’t overwrite your source |