A green-themed spreadsheet dashboard shows sales data, formulas, charts, pivot tables, and filtering tools.
Every time Microsoft drops a new dynamic-array function into Excel, a very predictable cycle begins. First comes the excitement from spreadsheet power users, followed immediately by bold declarations that a decades-old feature is officially dead and buried. Lately, the crosshairs have been trained on the venerable PivotTable, thanks to two powerhouse worksheet functions: GROUPBY and PIVOTBY.

On the surface, it is easy to see why spreadsheet enthusiasts are enamored. You type a single formula into a cell, hit Enter, and watch a clean, categorized, subtotaled summary table spill effortlessly across the grid. No ribbon menus, no dialog boxes, and no separate report objects required. However, as recent analysis from MakeUseOf points out, treating GROUPBY and PIVOTBY as outright replacements for classic PivotTables misunderstands what both tools actually are. Microsoft Support documentation makes the distinction explicit right at the top of its PIVOTBY reference: while the function can generate similar-looking outputs, it is not directly related to Excel’s PivotTable feature.

Moving pivot-style math into the formula bar is a massive leap forward for automated spreadsheets, but an array of numbers on a grid is not the same thing as an interactive analytical environment. Here is a complete breakdown of how Excel's newest aggregation functions work, where they shine, where their syntax gets tricky, and why the classic PivotTable isn't going anywhere.

A green-themed spreadsheet dashboard shows sales data, formulas, charts, pivot tables, and filtering tools. How GROUPBY and PIVOTBY Work in the Formula Layer​

To understand the divide between these tools, you first have to look at what GROUPBY and PIVOTBY actually do under the hood. Both are dynamic-array worksheet functions designed to group, aggregate, sort, and filter raw data in a single formula step.

Single-Axis Summaries with GROUPBY​

GROUPBY handles vertical, single-axis aggregation. According to Microsoft Support documentation, its full syntax is:

=GROUPBY(row_fields, values, function, [field_headers], [total_depth], [sort_order], [filter_array], [field_relationship])

You feed the function a column-oriented range or array for row_fields (which defines the categories you are grouping by), a range of values to summarize, and an aggregation function—such as SUM, AVERAGE, COUNT, or PERCENTOF—passed either as an explicit LAMBDA or a shorthand "eta-reduced" lambda function name. If you pass multiple columns into row_fields, Excel creates multi-level row groupings. You can also stack multiple value columns and multiple aggregation functions together using helper functions like HSTACK and VSTACK.

The optional arguments give you granular control over the spilled output without needing helper columns:

  • field_headers: Controls whether your source ranges include headers and whether they appear in the final output (0 for no, 1 for yes but hide, 2 for no but generate headers, and 3 for yes and show).
  • total_depth: Controls whether grand totals and subtotals appear (0 for no totals, 1 for grand totals, 2 for grand totals and subtotals, -1 for grand totals at the top, and -2 for grand and subtotals at the top). Note that generating subtotals (2 or -2) requires row_fields to have at least two columns.
  • sort_order: An index number (or vector of numbers) corresponding to the columns in row_fields followed by values. Positive numbers sort ascending; negative numbers sort descending.
  • filter_array: A column-oriented Boolean array matching the length of row_fields that filters out source records before aggregation happens.
  • field_relationship: Defaults to 0 (Hierarchy), where sorting later columns respects earlier parent columns, or 1 (Table), where each field column is sorted independently (though subtotals are not supported in Table mode).

Two-Axis Matrix Summaries with PIVOTBY​

While GROUPBY summarizes down the rows, PIVOTBY adds a col_fields argument so you can cross-tabulate data vertically and horizontally at the same time. Microsoft documents its syntax as:

=PIVOTBY(row_fields, col_fields, values, function, [field_headers], [row_total_depth], [row_sort_order], [col_total_depth], [col_sort_order], [filter_array], [relative_to])

Notice how PIVOTBY splits the total depth and sort order arguments into separate controls for rows (row_total_depth, row_sort_order) and columns (col_total_depth, col_sort_order). That means you should pay careful attention to argument positions when writing a formula from scratch. For instance, if you want both grand totals and subtotals on a two-column row_fields hierarchy, you must pass 2 (or leave the argument blank for automatic), whereas passing 1 restricts the output to grand totals only.

PIVOTBY also introduces the relative_to argument at the end of the syntax. When you use a two-argument aggregation function like PERCENTOF—or a custom LAMBDA(subset, totalset, SUM(subset)/SUM(totalset))—relative_to determines what the denominator (totalset) represents:

  • 0: Column Totals (Default)
  • 1: Row Totals
  • 2: Grand Totals
  • 3: Parent Column Total
  • 4: Parent Row Total

Why Formula-Layer Aggregation Is So Appealing​

Because GROUPBY and PIVOTBY live entirely inside Excel’s formula engine, their spilled results behave like any other dynamic array on your worksheet. When a number changes in your raw source range, the summary recalculates immediately.

More importantly, the output can seamlessly feed downstream calculations. You can point an XLOOKUP, FILTER, or dynamic chart range directly at a spilled PIVOTBY grid, or pass custom LAMBDA logic into the aggregation slot to perform bespoke calculations that standard PivotTable summary options struggle to express cleanly.

Section Summary: GROUPBY and PIVOTBY bring single-axis and two-axis data summarization directly into Excel's dynamic-array formula engine, complete with built-in sorting, filtering, subtotaling, and custom LAMBDA aggregation.


Where Classic PivotTables Still Dominate​

If these formulas can group, pivot, filter, sort, and calculate percentages of totals, why bother inserting a traditional PivotTable at all? Because a calculated array of cells is merely a static display of results, whereas a PivotTable is an interactive object backed by a dedicated reporting infrastructure.

Capability / FeatureGROUPBY & PIVOTBY FunctionsClassic Excel PivotTables
Core ArchitectureDynamic-array worksheet formulasObject-based interactive reporting tool
Layout ReconfigurationRequires editing formula arguments and cell referencesDrag-and-drop via the PivotTable Field List pane
Drill-Down to Source RowsNo built-in cell drill-through interactionBuilt-in Show Details (double-click value cell to spawn detail sheet)
Hierarchy NavigationStatic spilled grid (requires changing formula to alter depth)Interactive + / - buttons to expand or collapse levels on the fly
Data Model & BI IntegrationOperates on worksheet ranges and arraysConnects to Excel Data Model, Power Pivot, DAX, OLAP cubes, and Power BI
Visual Filtering ControlsFormula-driven filter_array (no direct Slicer connection)Native support for interactive Slicers and Timelines

1. Built-In Drill-Down ("Show Details") and Hierarchy Controls​

Imagine you are reviewing a quarterly regional sales summary in a meeting and an executive asks why a specific number looks unusually high. In a classic PivotTable, you simply double-click that summary value cell—or right-click and select Show Details—and Excel immediately generates a brand-new worksheet populated with the exact underlying transaction records that make up that number.

With GROUPBY or PIVOTBY, double-clicking a spilled cell just shows you the formula (or an empty formula bar if you clicked a cell outside the top-left anchor). There is no built-in Show Details drill-through action. Similarly, PivotTables provide interactive + and - expand and collapse buttons right on the row and column labels, letting users fold or unfold multi-level hierarchies—such as Country down to State down to City—without touching the report structure. A GROUPBY array spills all requested levels at once as a flat grid.

2. Drag-and-Drop Exploration vs. Formula Surgery​

Not everyone who consumes an Excel workbook wants to debug nested syntax. When you click inside a PivotTable, the PivotTable Field List appears, dividing your workflow into field selection and four drop zones: Filters, Columns, Rows, and Values. Any colleague can drag "Region" out of Rows and drop it into Columns, or add a second copy of a numeric field into Values to compare sums and averages side by side, and watch the report reorganize itself on the spot.

Doing the equivalent in PIVOTBY requires editing the formula’s range arguments, swapping row_fields and col_fields, or adjusting HSTACK and VSTACK vectors. For a solo analyst building a locked-down dashboard, formula editing is fine. For collaborative exploratory analysis across a broader business team, the Field List remains unmatched.

3. The Enterprise Ecosystem: Data Model, Power Pivot, and BI​

Worksheet functions operate on data that lives on the worksheet grid. PivotTables, on the other hand, are the front-end workhorse for Microsoft’s entire Excel Business Intelligence stack.

According to Microsoft Support documentation, PivotTables can connect directly to external relational databases (such as SQL Server and Access), Office Data Connection (.odc) files, OLAP cubes, and live Power BI semantic models. Furthermore, when you check Add this data to the Data Model during import, PivotTables can query multiple related tables simultaneously without a single XLOOKUP or VLOOKUP flattening the data first. Paired with Power Pivot and Data Analysis Expressions (DAX), a PivotTable can evaluate complex measures, KPIs, and time-intelligence logic across massive datasets that would bring standard worksheet formulas to a crawl.

4. Structured Retrieval and Formatting Nuances​

When you need to pull a specific figure out of a PivotTable to use elsewhere, Excel’s GETPIVOTDATA(data_field, pivot_table, [field1, item1],...) function lets you query the report by field and item name (for example, =GETPIVOTDATA("Sales", $A$3, "Month", "Mar")) regardless of where that row shifts when the PivotTable expands. With a spilled PIVOTBY array, you have to construct your own two-way XLOOKUP or INDEX/MATCH logic around the dynamic range.

Additionally, as spreadsheet practitioners at How-To Geek and the ICAEW Excel Community have noted, dynamic arrays cannot be converted into formal Excel Tables (Ctrl + T), and standard cell formatting applied to a sheet does not automatically move with spilled rows and columns when the array resizes—whereas PivotTables maintain dedicated, structure-aware formatting styles and support visual Slicers and Timelines natively.

5. Formula Complexity, Caching, and Version Compatibility​

What happens when you need a running total or a period-over-period variance inside a formula-driven summary? Because GROUPBY and PIVOTBY aggregate by group rather than calculating across adjacent output rows, achieving complex inter-row math often means wrapping your formula inside a labyrinth of LET, LAMBDA, MAP, SCAN, BYROW, TAKE, and DROP functions. It is an impressive technical flex, but good luck handing that workbook off to a coworker six months later.

There is also the architectural difference between formula recalculation and the PivotTable cache. Every time you create a PivotTable, Excel stores a dedicated copy of the report data in memory and inside the workbook file. Multiple PivotTables based on the same source can share that cache, and when working with heavy external data sources, you can even check Defer layout update in the Field List to rearrange fields without triggering queries until you click Update. While Microsoft has introduced automatic refresh options for local data in newer Microsoft 365 Insider builds, the traditional manual or on-open refresh model of a PivotTable cache gives analysts explicit control over when heavy data recalculates.

Finally, keep version compatibility on your radar—and verify exact edition support before sharing files externally. While PIVOTBY is documented by Microsoft Support as applying to Excel for Microsoft 365, Excel 2024, and Excel 2021 (across Windows and Mac), Microsoft's official GROUPBY support page currently lists Excel for Microsoft 365 under its "Applies To" header. If a client or colleague opens your workbook on an older perpetual release that lacks support for either function, your sleek dynamic summary will break into #NAME? errors.

Section Summary: PivotTables retain decisive advantages in interactive drill-down (Show Details), drag-and-drop reconfiguration, Slicers, relational Data Model and Power Pivot integration, cached refresh control, and backward compatibility across older Excel installations.


Practical Guide: Choosing the Right Tool for Your Workbook​

So, how should Windows and Microsoft 365 users decide which approach to use on Monday morning? Instead of treating this as a battle to the death, use this decision checklist based on your data architecture and audience:

  1. Choose GROUPBY or PIVOTBY when:
    • You are building an automated dashboard or model where the summary table must immediately feed downstream formulas (XLOOKUP, FILTER, SUMIFS) or dynamic charts without human intervention.
    • Your source data is a single flat table or dynamic array already living inside the worksheet, and everyone opening the file is on a supported Microsoft 365 (or verified modern Excel) build.
    • You want a compact, self-contained summary with custom LAMBDA aggregation logic and zero risk of someone accidentally forgetting to click "Refresh" before exporting a PDF.
  2. Choose a Classic PivotTable when:
    • You are handing the workbook to team members, managers, or clients who want to slice, filter, expand hierarchies (+/-), and drag fields around to answer their own ad-hoc questions.
    • You regularly double-click summary figures to audit the underlying line-item transactions via Show Details.
    • Your analysis spans multiple related tables in the Excel Data Model, relies on Power Pivot and DAX measures, or pulls from external SQL databases, OLAP cubes, or Power BI semantic models.
    • You need the workbook to open cleanly for external stakeholders who might be running older perpetual versions of Office.

GROUPBY and PIVOTBY are arguably among the best additions to Excel's formula vocabulary in the past decade. They don't make PivotTables obsolete; they liberate PivotTables from having to do basic, formula-level grunt work. Use the new functions to wire up your live calculation grids, and save the PivotTables for when you actually want to explore your data interactively.

 

References

  1. The new Excel functions everyone loves still can't do what a pivot table does MakeUseOf 2026-10-16T10:31:17+00:00
  2. These Excel functions just made PivotTables obsolete for me makeuseof.com
  3. Excel’s GROUPBY & PIVOTBY functions vs PivotTables | ICAEW icaew.com