How to Use the AGGREGATE Function in Excel
Today, we’ll explore the AGGREGATE function, an incredibly versatile tool available in both Microsoft Excel and Google Sheets. Designed to simplify various aggregation operations like AVERAGE, COUNT, MAX, MIN, and SUM, this function is especially useful for its ability to bypass errors and hidden rows in data calculations.
Basics of the AGGREGATE Function:
The AGGREGATE function allows you to perform different types of aggregate calculations. It relies on the function_num argument to determine the specific operation to conduct—ranging from averaging to summing up values. Crucially, this function also lets you selectively ignore hidden rows, errors, or other specific types of data that might skew your results.
How to Use the AGGREGATE Function:
The syntax for AGGREGATE is consistent across both Excel and Google Sheets:
=AGGREGATE(function_num, options, ref1, [ref2], …)
- function_num: A numeric code that selects the desired aggregation function (e.g., 1 for AVERAGE, 4 for MAX, 6 for MEDIAN, etc.).
- options: A parameter to specify data to exclude from calculations, such as 0 for including all data, 6 for excluding hidden rows, or 7 for excluding both hidden rows and error values.
- ref1, ref2, …: These are references to the data ranges or arrays to be included in your calculation.
Examples of the AGGREGATE Function:
Below are some practical applications of the AGGREGATE function to illustrate its adaptability:
Scenario | Excel Formula | Google Sheets Formula |
---|---|---|
Calculate the average of visible cells only | =AGGREGATE(1, 5, A1:A10) |
=AGGREGATE(1, 5, A1:A10) |
Find the maximum value ignoring errors | =AGGREGATE(4, 6, B1:B10) |
=AGGREGATE(4, 6, B1:B10) |
Count the number of visible cells containing numbers | =AGGREGATE(3, 5, C1:C10) |
=AGGREGATE(3, 5, C1:C10) |
These examples demonstrate how the AGGREGATE function can be customized to meet specific data analysis needs in both Excel and Google Sheets, providing a high degree of flexibility in handling diverse datasets.
More information: https://support.microsoft.com/en-us/office/aggregate-function-43b9278e-6aa7-4f17-92b6-e19993fa26df