GROUPBY vs SUMIF in Excel

Reading time: 2 minutes

The GROUPBY function, introduced in March 2024 in Excel 365, is a game-changer! Instead of writing complex COUNTIF or SUMIF formulas, you can now use a single function to group and summarize data without extra steps. This article explains why GROUPBY is easier and provides simple examples.

Why GROUPBY is Easier Than COUNTIF and SUMIF

COUNTIF and SUMIF require separate formulas for each condition. GROUPBY does it all in one go!

  • No need for helper columns – GROUPBY structures data instantly.
  • Works like a Pivot Table but updates automatically.
  • One function replaces multiple formulas (COUNTIF, SUMIF, UNIQUE)
  • With only 3 arguments, you can return the same result as COUNTIF, COUNTIFS, SUMIF, SUMIFS

Let’s see how to use it!

How to Write the GROUPBY Function

  1. Row labels: Select the column to group (e.g., “Region”).
  2. Values to summarize: Choose a column like “Sales.”
  3. Calculation type: Use SUM, COUNT, MAX, or MIN.
  4. Show headers: Decide if headers should appear.
  5. Grand total: Add a total row if needed.
  6. Sort order: Indicate sorting (e.g., column index 1, ascending).

Don’t worry about the arguments! A tooltip guides you through them 😉

Examples: GROUPBY vs. Traditional Formulas

#1: Count Sales by Region

Instead of using COUNTIF for each region, use GROUPBY.

GROUPBY function to count rows

COUNTIF method:

  • List regions manually or use UNIQUE.
  • Write a COUNTIF formula for each region.
Same result with COUNTIF

GROUPBY method: One formula, no extra steps! 😃👍

#2: SUM of Sales per Region

Replace COUNT with SUM, and GROUPBY works like SUMIF.

GROUPBY replaces SUMIF

Grouping by Multiple Columns

Multiple columns, even non-adjacent ones, can be used as the first argument. Just use CHOOSECOLS to select specific columns.

GROUPBY with multiple columns

Why Use GROUPBY?

  • Faster & dynamic: Updates instantly when data changes.
  • More flexible than pivot tables: Works directly in formulas.
  • One function, multiple summaries: COUNT, SUM, MAX, and more.
  • Build full reports in a single formula!

Start using GROUPBY today and simplify your Excel formulas! 🚀

Practice with exercises

Practice the SUMIF function directly in the grid below.

SUMIF Exercise - Total sales by salesperson, region or product

Total up a sales portfolio by salesperson, region and product using SUMIF, both with a fixed value and with a cell reference — 6 guided steps.

=SUMIF( criteria_range , "criteria" , sum_range )

1 / 6

You have a portfolio of 15 sales with the salesperson, the client, the region, the product and the amount.
In G2, calculate the total revenue of Martin. Type the name in full inside the formula.

SUMIF Sales — Q1 · 569

=SUMIF( criteria_range , cell , sum_range )

2 / 6

In G2, calculate the total revenue of Dubois. Cell G1 holds the name of the salesperson — use that cell reference.

SUMIF Sales — Q2 · 570

=SUMIF( criteria_range , "criteria" , sum_range )

3 / 6

Total revenue for the North region

SUMIF Sales — Q3 · 571

=SUMIF( criteria_range , cell , sum_range )

4 / 6

In G2, calculate the total revenue of the South region. Cell G1 holds the criteria — use that reference.

SUMIF Sales — Q4 · 572

=SUMIF( criteria_range , "criteria" , sum_range )

5 / 6

Total revenue for Pro License

SUMIF Sales — Q5 · 573

=SUMIF( criteria_range , cell , sum_range )

6 / 6

In G2, calculate the total revenue generated by Training. Cell G1 holds the criteria — use that reference.

SUMIF Sales — Q6 · 574

Your score is

0%

Related articles

Leave a Reply

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

GROUPBY vs SUMIF in Excel

Reading time: 2 minutes

The GROUPBY function, introduced in March 2024 in Excel 365, is a game-changer! Instead of writing complex COUNTIF or SUMIF formulas, you can now use a single function to group and summarize data without extra steps. This article explains why GROUPBY is easier and provides simple examples.

Why GROUPBY is Easier Than COUNTIF and SUMIF

COUNTIF and SUMIF require separate formulas for each condition. GROUPBY does it all in one go!

  • No need for helper columns – GROUPBY structures data instantly.
  • Works like a Pivot Table but updates automatically.
  • One function replaces multiple formulas (COUNTIF, SUMIF, UNIQUE)
  • With only 3 arguments, you can return the same result as COUNTIF, COUNTIFS, SUMIF, SUMIFS

Let’s see how to use it!

How to Write the GROUPBY Function

  1. Row labels: Select the column to group (e.g., “Region”).
  2. Values to summarize: Choose a column like “Sales.”
  3. Calculation type: Use SUM, COUNT, MAX, or MIN.
  4. Show headers: Decide if headers should appear.
  5. Grand total: Add a total row if needed.
  6. Sort order: Indicate sorting (e.g., column index 1, ascending).

Don’t worry about the arguments! A tooltip guides you through them 😉

Examples: GROUPBY vs. Traditional Formulas

#1: Count Sales by Region

Instead of using COUNTIF for each region, use GROUPBY.

GROUPBY function to count rows

COUNTIF method:

  • List regions manually or use UNIQUE.
  • Write a COUNTIF formula for each region.
Same result with COUNTIF

GROUPBY method: One formula, no extra steps! 😃👍

#2: SUM of Sales per Region

Replace COUNT with SUM, and GROUPBY works like SUMIF.

GROUPBY replaces SUMIF

Grouping by Multiple Columns

Multiple columns, even non-adjacent ones, can be used as the first argument. Just use CHOOSECOLS to select specific columns.

GROUPBY with multiple columns

Why Use GROUPBY?

  • Faster & dynamic: Updates instantly when data changes.
  • More flexible than pivot tables: Works directly in formulas.
  • One function, multiple summaries: COUNT, SUM, MAX, and more.
  • Build full reports in a single formula!

Start using GROUPBY today and simplify your Excel formulas! 🚀

Practice with exercises

Practice the SUMIF function directly in the grid below.

SUMIF Exercise - Total sales by salesperson, region or product

Total up a sales portfolio by salesperson, region and product using SUMIF, both with a fixed value and with a cell reference — 6 guided steps.

=SUMIF( criteria_range , "criteria" , sum_range )

1 / 6

You have a portfolio of 15 sales with the salesperson, the client, the region, the product and the amount.
In G2, calculate the total revenue of Martin. Type the name in full inside the formula.

SUMIF Sales — Q1 · 569

=SUMIF( criteria_range , cell , sum_range )

2 / 6

In G2, calculate the total revenue of Dubois. Cell G1 holds the name of the salesperson — use that cell reference.

SUMIF Sales — Q2 · 570

=SUMIF( criteria_range , "criteria" , sum_range )

3 / 6

Total revenue for the North region

SUMIF Sales — Q3 · 571

=SUMIF( criteria_range , cell , sum_range )

4 / 6

In G2, calculate the total revenue of the South region. Cell G1 holds the criteria — use that reference.

SUMIF Sales — Q4 · 572

=SUMIF( criteria_range , "criteria" , sum_range )

5 / 6

Total revenue for Pro License

SUMIF Sales — Q5 · 573

=SUMIF( criteria_range , cell , sum_range )

6 / 6

In G2, calculate the total revenue generated by Training. Cell G1 holds the criteria — use that reference.

SUMIF Sales — Q6 · 574

Your score is

0%

Related articles

Leave a Reply

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