...

/

Conditional Aggregations

Conditional Aggregations

Learn to aggregate data for specific groups or categories using built-in conditional functions.

Basic aggregations gave us a full-picture view of our data. Now imagine we need to zoom in, such as finding total sales just for the “North” region, or the average customer satisfaction score only for “Product X,” or perhaps the count of employees who are “Active” and in the “Marketing” department? This is where conditional aggregations become incredibly powerful. Instead of manually filtering our data and then applying a SUM() or AVERAGE(), we can use these intelligent functions to automatically perform calculations only on the data that meets our specified criteria. This gives us highly targeted insights, saving immense time and making our analysis much more precise.

In this lesson, we’ll explore the key Google Sheets functions that allow us to aggregate data based on one or more conditions.

Summing with conditions

When working with real data, we need to break down totals to uncover what contributes most to our results. Whether it’s measuring sales by region, expenses by department, or revenue from a specific product, applying one or more conditions allows us to focus on the data that matters.

Conditional summing enables us to move beyond general totals and deliver precise, context-specific insights that drive better decisions and deeper understanding.

Summing with one condition

Sometimes we need to sum data based on a single, simple criterion. For example, what is the total revenue generated only from the “Online” sales channel? Or the total number of hours worked specifically on “Project A”? The SUMIF() function is our go-to tool for these single-condition calculations. It takes three parameters, as mentioned below.

  • range: The range of cells that Google Sheets will evaluate against the given criterion.

  • criterion: The condition or pattern that cells in the range must meet (e.g., “Online,””>100,” “=Laptop”).

  • sum_range (Optional): The actual range of cells that contain the numbers we want to sum. If we omit this, range itself will be summed.

Suppose we use a simple ...