Excel AVERAGEIFS function with multiple criteria (2024)

This tutorial shows how to use the Excel AVERAGEIFS function for calculating an average with multiple conditions.

When it comes to calculating an arithmetic mean of a group of numbers in Excel, AVERAGE is the way to go. To average cells that meet a certain condition, AVERAGEIF comes in handy. To find an average with multiple criteria, AVERAGEIFS is the function to use. To learn how it works, please keep reading!

AVERAGEIFS function in Excel

The Excel AVERAGEIFS function calculates the arithmetic mean of all cells in a range that meet the specified criteria.

The syntax is as follows:

AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], …)

Where:

  • Average_range - the range of cells to average.
  • Criteria_range1, criteria_range2, … - ranges to be tested against the corresponding criteria.
  • Criteria1, criteria2, … - criteria that determine which cells to average. The criteria can be supplied in the form of a number, logical expression, text value, or cell reference.

Criteria_range1 / criteria1 are required, subsequent ones are optional. 1 to 127 range/criteria pairs can be used in one formula.

The AVERAGEIFS function is available in Excel 2007 - Excel 365.Excel AVERAGEIFS function with multiple criteria (1)

Note. The AVERAGEIFS function works with the AND logic, i.e. only those cells are averaged for which all the conditions are TRUE. To calculate cells for which any single condition is TRUE, use the AVERAGE IF OR formula.

AVERAGEIFS function - usage notes

To get a clear understanding of how the function works and avoid errors, take notice of the following facts:

  • In the average_range argument, empty cells, logical values TRUE/FALSE, and text values are ignored. Zero values are included.
  • If criteria is an empty cell, it is treated as a zero value.
  • If average_range doesn't contain a single numeric value, a #DIV/0! error occurs.
  • If no cells meet all of the specified criteria, a #DIV/0! error is returned.
  • AVERAGEIFS' criteria may apply to the same range or different ranges.
  • Each criteria_range must be of the same size and shape as average_range, otherwise a #VALUE! error occurs.

Now that you know the theory, let's see how to use the AVERAGEIFS function in practice.

Excel AVERAGEIFS formula

First, let us outline the generic approach. To construct an AVERAGEIFS formula correctly, please follow these guidelines:

  1. In the first argument, supply the range that you want to average.
  2. In subsequent arguments, specify range/criteria pairs. The pairs can be arranged in any order, but the criteria always follows the range it applies to.
  3. An AVERAGEIFS formula should always contain an odd number of arguments: average_range + one or more criteria_range/criteria pairs.

AVERAGEIFS with text criteria

To get an average of numbers in one column if another column(s) contains certain text, use that text for criteria.

As an example, let's find an average of the "Apple" sales in the "North" region. For this, we make an AVERAGEIFS formula with two criteria:

  • Average_range is C3:C15 (cells to average).
  • Criteria_range1 is A3:A15 (Items to check) and criteria1 is "apple".
  • Criteria_range2 is B3:B15 (Regions to check) and criteria2 is "north".

Putting the arguments together, we get the following formula:

=AVERAGEIFS(C3:C15, A3:A15, "apple", B3:B15, "north")

With criteria in predefined cells (F3 and F4), the formula takes this form:

=AVERAGEIFS(C3:C15, A3:A15, F3, B3:B15, F4)Excel AVERAGEIFS function with multiple criteria (2)

AVERAGEIFS with logical operators

When the criteria default to "is equal to", the equality sign can be omitted, and you simply put the target text (enclosed in quotation marks) or number (without the quotation marks) in the corresponding argument like shown in the previous example.

When using other logical operators such as "greater than" (>), "less than" (<), not equal to (<>), and others with a number or date, you enclose the whole construction in double quotes.

For example, to average sales greater than zero delivered by 1-Oct-2022, the formula is:

=AVERAGEIFS(C3:C15, B3:B15, "<10/1/2022", C3:C15, ">0")

When the criteria are in separate cells, you enclose a logical operator in quotation marks and concatenate it with a cell reference using an ampersand (&). For example:

=AVERAGEIFS(C3:C15, B3:B15, "<"&F3, C3:C15, ">"&F4)Excel AVERAGEIFS function with multiple criteria (3)

AVERAGEIFS with wildcard characters

To average cells based on partial text match, use wildcard characters in criteria - a question mark (?) to match any single character or an asterisk (*) to match any number of characters.

In the table below, suppose you wish to average "orange" sales in all "south" regions including "south-west" and "south-east". To have it done, we include an asterisk in the second criteria:

=AVERAGEIFS(C3:C15, A3:A15, F3, B3:B15, "south*")

If a partial text match criteria is input in a cell, then concatenate a wildcard character with the cell reference. In our case, the formula takes this shape:

=AVERAGEIFS(C3:C15, A3:A15, F3, B3:B15, F4&"*")Excel AVERAGEIFS function with multiple criteria (4)

Average if between two values

To get the average of values that fall between two specific values, use one of the following generic formulas:

Average if between two values, inclusive:

AVERAGEIFS(average_range, criteria_range,">=value1", criteria_range,"<=value2")

Average if between two values, exclusive:

AVERAGEIFS(average_range, criteria_range,">value1", criteria_range,"<value2")

In the 1st formula, you use the greater than or equal to (>=) and less than or equal to (<=) logical operators, so the boundary values are included in the average.

In the 2nd formula, the greater than (>) and less than (<) logical criteria exclude the boundary values from the average.

These formulas work nicely or both scenarios - when the cells to average and the cells to check are in the same column or in two different columns.

For example, to calculate the average of sales between 100 and 130 inclusive, you can use this formula:

=AVERAGEIFS(C3:C15, C3:C15, ">=100", C3:C15, "<=130")

With the boundary values in cells E3 and F3, the formula takes this form:

=AVERAGEIFS(C3:C15, C3:C15, ">="&E3, C3:C15, "<="&F3)

Please notice that in this case we use the same reference (C3:C15) for the 3 range arguments.Excel AVERAGEIFS function with multiple criteria (5)

To average cells in a given column if the values in another column fall between two values, supply a different range for the average_range and criteria_range arguments.

For instance, to average the sales in column C if the date in column B is between 1-Sep and 30-Oct, the formula is:

=AVERAGEIFS(C3:C15, B3:B15, ">=9/1/2022", B3:B15, "<=10/30/2022")

With cell references:

=AVERAGEIFS(C3:C15, B3:B15, ">="&E3, B3:B15, "<="&F3)Excel AVERAGEIFS function with multiple criteria (6)

That's how you use the AVERAGEIFS function in Excel to find an arithmetic mean with multiple criteria. I thank you for reading and hope to see you on our blog next week!

Practice workbook for download

Excel AVERAGEIFS function - examples (.xlsx file)

You may also be interested in

  • Calculating mean, median and mode
  • MEDIAN function with examples
  • Calculate weighted average in Excel
  • Find moving average in Excel
  • MAXIFS function to get largest value with criteria
Excel AVERAGEIFS function with multiple criteria (2024)

FAQs

How do you use Averageifs with multiple criteria? ›

The Excel AVERAGEIFS function calculates the arithmetic mean of all cells in a range that meet the specified criteria. The syntax is as follows: AVERAGEIFS(average_range, criteria_range1, criteria1, [criteria_range2, criteria2], …)

How do you average all values that meet criteria in Excel? ›

The AVERAGEIFS function is a premade function in Excel, which calculates the average of a range based on one or more true or false condition. It is typed =AVERAGEIFS : =AVERAGEIFS(average_range, criteria_range1, criteria1, ...)

How to calculate weighted average with multiple criteria in Excel? ›

To calculate the weighted average in Excel, you must use the SUMPRODUCT and SUM functions using the following formula: =SUMPRODUCT(X:X,X:X)/SUM(X:X) This formula works by multiplying each value by its weight and combining the values. Then, you divide the SUMPRODUCT but the sum of the weights for your weighted average.

What returns the average of all cells that meet multiple criteria? ›

AVERAGEIFS returns the average of all cells that meet multiple criteria. This is the syntax of the AVERAGEIFS function. average_range is required. It is one or more cells to average.

How many criteria can Averageifs have? ›

Criteria1 is required, subsequent criteria are optional. 1 to 127 criteria in the form of a number, expression, cell reference, or text that define which cells will be averaged.

How many conditions can be used in Averageif functions? ›

The AVERAGEIF function is used to calculate an average of all cells in a given range that meet a certain condition. The function has a total of 3 arguments - the first 2 are required, the last one is optional: Range (required) - the range of cells to test against the criteria.

How to get Excel to return a value based on multiple criteria? ›

To perform an INDEX MATCH with multiple criteria in Excel, simply use an ampersand (&) to place multiple references in your lookup value and lookup array inputs in the MATCH formula.

What is the formula for multiple criteria in Excel? ›

The Excel IF function with two or more conditions follows a generic formula: =IF(AND(condition1, condition2, ...), value_if_true, value_if_false). What this means is that “If condition 1 is true AND condition 2 is true, return value_if_true; else return value_if_false.”

How do you sum data that meet multiple criteria? ›

The SUMIFS function, one of the math and trig functions, adds all of its arguments that meet multiple criteria.

Can you average multiple averages? ›

If you attempt to create an “average of averages”, the single data point will disproportionately affect the outcome. The average of 10,000 data items basically gets valued at the same rate as the average of the single data point. The “average of averages” would be 6, but the correct average of all values would be 10.

What is the difference between Averageif and Averageifs? ›

In terms of functionality, the most essential difference is that AVERAGEIF can only handle one condition while AVERAGEIFS one or more criteria.

What is the max function with multiple criteria in Excel? ›

The syntax of the MAXIFS function is as follows: MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], …) Where: Max_range (required) - the range of cells where you want to find the maximum value.

How do you average multiple values? ›

Average This is the arithmetic mean, and is calculated by adding a group of numbers and then dividing by the count of those numbers. For example, the average of 2, 3, 3, 5, 7, and 10 is 30 divided by 6, which is 5. Median The middle number of a group of numbers.

How to do multiple averages at once in Excel? ›

To average values in cells and ranges of cells that aren't adjacent, type an equals sign (a formula always starts with an equals sign), AVERAGE, open parenthesis, hold down the Ctrl key, click the desired cells and ranges of cells, and press Enter.

How do you find the average of multiple groups? ›

How to calculate the average
  1. Determine what you want to be averaged. To calculate the average, determine what exactly you want to be averaged. ...
  2. Find the sum of the data set. ...
  3. Determine the amount of numbers in your data set. ...
  4. Divide the sum by the total of numbers in your data set.
Oct 7, 2022

Top Articles
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 5940

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.