Average with Multiple Criteria in Excel

AVERAGEIFS function is one of the most popular functions in Excel. Apply AVERAGEIFS function, we can calculate average simply if there are multiple conditions.

In this article, we will introduce you to apply AVERAGEIFS function to calculate average of a set of numbers which are filtered by multiple criteria. You can get the basic knowledge and usage of AVERAGEIFS function in this article.

EXAMPLE

Average with Multiple Criteria 1

In this case, we want to calculate the average of sales based on different fruit in different week. Obviously, there are two criteria in this case, one is “kind of fruit”, the other one is “week number”. For example, to get average for “apple” in “week1”, we need to look up values from “Sales” which corresponding fruit and week number can satisfy above two conditions.

In this article, to approach our goal, we can apply AVERAGEIFS function.

SOLUTION

As there are two conditions in this case, so we need to choose a function that can handle multiple conditions, and at the same time can execute average calculation, so AVERAGEIFS is the best choice. If there is only one condition, we can also apply AVERAGEIF function.

FORMULA with AVERAGEIFS FUNCTION

In G2, we input the formula =AVERAGEIFS(Sales,Fruit,E2,Week,F2). After typing, press Enter, average of sales for different fruit in different weeks is returned properly.

Average with Multiple Criteria 1

Three values in “Sales” can meet our condition “Fruit=Apple & Week Number=1”, there are C2-100, C3-200, C4-150, so the average is (100+200+150)/3=150, the formula returns correct value.

Drag down handle to fill other cells with the same formula in Average column.

Average with Multiple Criteria 1

FUNCTION INTRODUCTION

In this instance we only apply one function, it is “AVERAGEIFS”, it is one of the most popular functions in Excel. It can be seen as AVERAGE and IFs, similar with SUMIFS, AVERAGIFS can handle multiple criteria when calculating average.

AVERGAEIFS function returns the average of a set of numbers in range based on one or more given conditions or criteria.

Syntax:

=AVERAGEIFS (average_range, criteria_range1, criteria1, [criteria_range2], [criteria2], ...)

For AVERAGEIFS functions, it can handle wildcards like asterisk ‘*’ and question mark ‘?’; it also supports logical operations like ‘>=’,’<=’. If we need entering wildcards or logical operators to build criteria, they should be enclosed into double quotes (““).

Example.

Average with Multiple Criteria 1

FORMULA EXPLANATION

=AVERAGEIFS(Sales,Fruit,E2,Week,F2)

// average_range is named range “Sales”.

//criteria_range1 is named range “Fruit”, criteria1 is value in E2.

//criteria_range2 is named range “Week”, criteria2 is value in F2.

a. For the first group of criteria range and criteria, expand values in “Fruit” and “E2”:

{"Apple";"Apple";"Apple";"Banana";"Banana";"Banana";"Apple";"Apple";"Apple";"Banana";"Banana";"Banana"},"Apple"

Filter data from “Fruit” refer to criteria1 “Fruit=Apple”:

{TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;TRUE;TRUE;TRUE;FALSE;FALSE;FALSE}

b. For the second group of criteria range and criteria, expand values in “Week” and “F2”:

{1;1;1;1;1;1;2;2;2;2;2;2},1

Filter data from “Week” refer to criteria2 “Week=1”:

{TRUE;TRUE;TRUE;TRUE;TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE}

c. After filtering data from two groups, we can notice that only the first three positions in both two arrays are “TRUE”. Thus we only need to extract the first three values from average range and then come to AVERAGE calculation.

{100;200;150}

After above all steps, we get =AVERAGE({100;200;150}). So, the returned value is (100+200+150)/3=150.

Related Functions


  • Excel AVERAGE function
    The Excel AVERAGE function returns the average of the numbers that you provided.The syntax of the AVERAGE function is as below:=AVERAGE (number1,[number2],…)….
  • Excel AVERAGEIF function
    The Excel AVERAGEAIF function returns the average of all numbers in a range of cells that meet a given criteria.The syntax of the AVERAGEIF function is as below:= AVERAGEIF (range, criteria, [average_range])….
  • Excel AVERAGEIFS function
    The Excel AVERAGEAIFS function returns the average of all numbers in a range of cells that meet multiple criteria.The syntax of the AVERAGEIFS function is as below:= AVERAGEIFS (average_range, criteria_range1, criteria1, [criteria_range2, criteria2],…)….

 

Related Posts
If Cell is This Value or That Value

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of logical test. If you want to see if a cell is A or B, and if one of ...

If Value is Greater Than A Certain Value
If Value is Greater Than A Certain Value 1

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the logical test result. If you want to see if a value in one cell is greater than a specific value, ...

If Cell is Not Blank
If Cell is Not Blank 6

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of created logical test. If you want to see if a cell is blank or not, and leave some ...

If Cell is Blank
If Cell is Blank_1

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of created logical test. If you want to see if a cell is blank or not, and leave some ...

If Cell Equals Certain Text String
If cell equals certain text_1

IF function is frequently used in Excel worksheet to return you expect “true value” or “false value” based on the result of created logical test. If you want to see if cell equals a certain text string like “Win”, you ...

If Cell Contains Either Text1 or Text2
If cell contains text1 or text2_1

IF function is frequently used in Excel worksheet to return “true value” or “false value” based on the logical test result. If you want to see if cell contains certain substring1 like “abc” or substring2 like “def”, and returns true ...

If Cell Contains Certain Text OR Equals Certain Text

IF cell equals certain text IF function is frequently used in Excel worksheet to return “true value” or “false value” based on the logical test result. If you want to test values to see if they equal certain text like ...

VLOOKUP From Another Sheet Not Working
vlookup from another sheet not working3

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you reasons why your VLOOKUP formula is not working ...

If Cell Begins with One of Three Supplied Characters
If Cell Begins with One of Three Supplied Characters

If you want to test values to see if they begin with some given specific characters like “x”, ”y”, or “z”, you can create a formula with COUNTIF and SUM functions to return results. EXAMPLE You can see “TRUE” or ...

Fix #N/A Error For VLOOKUP From Another Sheet
vlookup from anther sheet not working1

This post will show you how to fix the #N/A error why it occurs when you extract values from another sheet using VLOOKUP function in Excel 2016,2013,2010 or other Excel versions. How can you correct a #N/A error in VLOOKUP ...

Sidebar