By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: I switched from pivot tables to GROUPBY formulas and my analysis updates itself
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > I switched from pivot tables to GROUPBY formulas and my analysis updates itself
Computing

I switched from pivot tables to GROUPBY formulas and my analysis updates itself

News Room
Last updated: 2025/09/27 at 5:14 PM
News Room Published 27 September 2025
Share
SHARE

When it comes to data analysis, pivot tables are very useful, and many Excel pros vouch for them. However, they do not automatically update when the data changes, placing that easy-to-forget job on the user. Luckily, Excel has the GROUPBY function, which allows me to create something structurally similar to a pivot table but with dynamic capabilities.

Pivot tables are easy to create, as you can do so in just a few clicks. But I assure you that using the GROUPBY formula to analyze your data is not that hard—it can even change the way you write formulas from now on. Furthermore, you can use GROUPBY formulas with slicers by employing a neat workaround to instantly filter them as needed.

How to use the GROUPBY function in a formula

A great alternative to pivot tables

GROUPBY is an Excel function that allows you to group rows based on one or more columns and then aggregate them using other functions. It’s a dynamic array function, meaning it performs calculations on multiple cells and returns either a single result or multiple results. It was introduced in Excel 365, meaning it’s not available in Excel 2019 or older.

Here’s the syntax of the GROUPBY function with the required parameters:

        =GROUPBY(row_fields, values, function)

The row_fields parameter specifies the category or column by which to group your data (e.g., date, month, sales, or department). The values parameter is the range with the values you want to aggregate. Finally, the function parameter is, well, the function that will aggregate the values (e.g., SUM, AVERAGE, and COUNT).

Now, suppose I have a table with sales data and want to determine the total sales for each employee. Here is what that formula would look like (notice I’m also including the headers in the function):

        =GROUPBY(Table1[[

Essentially, the formula creates an array that lists every salesperson and their total sales. I selected the Salesperson and Sales columns for the row_fields and values parameters, respectively. For the function parameter, I used SUM.

I can easily achieve the same result with a pivot table by dragging the Salesperson field into Rows and the Sales field into Values. It will also be nicely formatted. However, if I change anything in the sample table, the GROUPBY function will automatically update the returned table.

You can select more than one column for the row_fields parameter in the GROUPBY function, but they will appear in the order they appear in the table. To order them however you want, you can use the HSTACK function.

        =GROUPBY(HSTACK(Table1[[

About those optional parameters…

Take full advantage of the GROUPBY function

The basic GROUPBY function works well, but I quickly discovered that those optional parameters can spice things up even more.

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

Here’s what each parameter does:

  • field_headers: Allows you to specify if headers should be displayed or not. The value Missing (default) = Automatic, 0 = No, 1 = Yes but don’t show, 2 = No but generate, and 3 = Yes and show.
  • total_depth: Allows you to specify whether to show subtotals and grand totals. The value Missing (default) = Grand totals and, where possible, subtotals, 0 = No totals, 1 = Grand totals, 2 = Grand totals and subtotals, -1 = Grand totals at top, and -2 = Grand totals and subtotals at top.
  • sort_order: This parameter lets you specify how your results should be sorted. For instance, if you want to sort by the fourth column in the table in ascending order, you would enter 4. Entering -4 will sort it in descending order.
  • filter_array: This allows you to filter the results, showing only rows that meet specified criteria.
  • field_relationship: Specifies how to group data when you enter multiple columns in the row_fields parameter, with 0 (default) = Hierarchy and 1 = Table.

Here’s an example of the full formula in action:

        =GROUPBY(Table1[[

The field_headers parameter is set to show the headers, while the total_depth parameter shows the grand totals at the top. The sort_order parameter sorts the results based on the second column (Sales) in descending order. The filter_array parameter uses conditional logic to display only those whose name (Salesperson column) is not Alice.

Using slicers with the GROUPBY function

Sort data with the click of a button

One thing that makes pivot tables so great is that they work with slicers. Slicers can also work with the GROUPBY function, but they require a helper column to facilitate filtering.

Since slicers work with tables, I have to first ensure the data is in a table format. Then, I created a column that will serve as the filter (I named it Filter, but you can call it anything). From there, I use the SUBTOTAL function to help me determine if a row is empty or not.

        =SUBTOTAL(103, [@Salesperson])

I picked the COUNTA function (103) to use with SUBTOTAL because it ignores hidden rows—it returns 1 if the referenced cell is nonempty and visible, and 0 if it’s hidden or empty. I used the Salesperson column as the reference value because I know it will never be empty or hidden. Once I entered this formula in the first cell of the filter column, it was automatically added to the rest of the cells since this is a table.

I then created a slicer using the Salesperson column and moved it to a separate sheet. Afterward, I entered the Filter column in the filter_array parameter of the GROUPBY function so it can work with the slicer.

        =GROUPBY(Table1[[

Now I use the slicer to filter the resulting array of the GROUPBY function. Keep in mind that it will also filter the source table.

The GROUPBY formulas are not a replacement for pivot tables

GROUPBY is an alternative to pivot tables, not a wholesale replacement—use it when you need dynamic, formula-based aggregations. Furthermore, it provides greater control via formulas and is more transparent and editable. I will miss the interactivity, convenience, and efficiency of pivot tables, but GROUPBY formulas seem to be capable of handling my data analysis needs for now.

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article The Best T-Mobile Phones We’ve Tested for 2025
Next Article LCD vs. LED: Which TV Technology Should You Choose?
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

USD Coin, XRP, and Solana: Unlocking Investor Potential with Hashj Cloud Platform, Earning $4,999 a Day
Gadget
Something is seriously wrong with YouTube TV multiview, users say
News
How to Schedule Videos to Instagram with in 2025
Computing
Lowest price ever: 15" MacBook Air M3, 24GB, 512GB plunges to $1,099 ($600 off)
News

You Might also Like

Computing

How to Schedule Videos to Instagram with in 2025

4 Min Read
Computing

ARM64 With Linux 6.18 To Accept Secrets From Firmware & More

1 Min Read
Computing

Tencent Robotics X Lab reveals The Five, a hybrid home help robot · TechNode

1 Min Read
Computing

10 Questions To Ask Influencers Before Your Next Campaign |

7 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?