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

Extract Unique Items From A List
Extract Unique Items From A List In Excel1

This post will guide you how to extract unique itmes from a given list in Microsoft Excel. How to create a newly formula to get unique values from a range cells in Excel. The unique list of items is the ...

Extract substring In Excel
Extract substring In Excel1

This post will guide you how to use Excel's MID function is a quick and easy way to extract pieces from your text. Use the Excel formula to extract a substring with MID. Note: If you want to extract just ...

How to Use 3D SUM Multiple Worksheets
3D sum multiple worksheets1

To sum a range of numbers is straightforward for most Excel users, but do you know how to establish a 3D reference to total the same range of numerous sheets. In this post, I will present the steps for this ...

Extract all the matches with helper Column
how to extract all matches with helper column1

With Excel's powerful functions IF, INDEX, and MATCH, we can find exactly what you're looking for with a few clicks of the mouse. This step-by-step tutorial will show how easy it is to extract data using these tools and more! ...

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 ...

Sidebar