How to Use AVERAGEIFS Function for Multiple Columns

 

Example 1 – Calculating the Average Price

Our dataset is a Price Chart of Shoes. We’ll determine the Average Price based on a few factors.

averageifs multiple columns

Steps:

  • Create a table as marked in the following image in your worksheet.

  • Enter the formula given below in cell D22.
=AVERAGEIFS($D$5:$D$19,$B$5:$B$19,B22,$C$5:$C$19,C22)
  • Press Enter.

Using Excel formula to use the AVERAGEIFS function for multiple columns

  • You will get the Average Price for Size M shoes in Red Color.

  • Use the AutoFill feature to get the rest of the outputs as demonstrated in the following picture.

Final output of method 1 to use the AVERAGEIFS function for multiple columns


Read More: How to Use Excel AVERAGEIFS Function with Multiple Criteria


Example 2 – Computing the Average Marks

We have the Marks of Grade 6 and Grade 7 Students as our dataset. We’ll calculate the Average Marks of the students based on Grade and Section.

Computing Average Marks by using AVERAGEIFS for multiple column

Steps:

  • Create a table for the criteria and results.

  • Enter the following formula in cell D19.
=AVERAGEIFS($D$5:$D$16,$B$5:$B$16,B19,$C$5:$C$16,C19)
  • Hit Enter.

Here are the results.

  • by using the AutoFill option, you can get the remaining outputs.

Final output of method 2 by using AVERAGEIFS for multiple column in Excel


How to Calculate the Average of Multiple Columns Based on a Single Condition

We have an Experimental Data Analysis as our dataset with 3 Experiment Codes. Each Experiment has 4 sets of data for 5 Iterations. We’ll calculate the Average of each Experiment data for all Iterations.

How to Calculate Average of Multiple Columns Based on Single Condition


Method 1 – Applying AVERAGE and FILTER Functions

Steps:

  • Create a table for the results.

Applying AVERAGE and FILTER Functions in Excel

  • Enter the formula given below in cell C19.
=AVERAGE(FILTER($C$5:$G$16,$B$5:$B$16=B19))

Formula Breakdown

  • FILTER($C$5:$G$16,$B$5:$B$16=B19) → Returns the filtered data from the range $C$5:$G$16 based on a condition.
    • $C$5:$G$16 → The array argument.
    • $B$5:$B$16=B19 →Refers to the include argument.
    • Output {30,5,29,2,16;11,13,13,30,11;10,12,22,12,20;26,21,14,22,9}.
  • AVERAGE(FILTER($C$5:$G$16,$B$5:$B$16=B19)) Becomes AVERAGE({30,5,29,2,16;11,13,13,30,11;10,12,22,12,20;26,21,14,22,9}).
    • Output → 16.40.
  • Press Enter.

  • You will have the Average of all the Iterations of Experiment A.

  • Use the AutoFill option to get the remaining outputs.

Final output of method 3 to use the AVERAGEIFS function for multiple columns

Read More: Excel AVERAGEIFS with Multiple Criteria in Same Range


Method 2 – Using AVERAGE and IF Functions

Steps:

  • Create a table for the results.

Using AVERAGE and IF Functions to use the AVERAGEIFS function for multiple columns

  • Enter the following formula in cell C19.
=AVERAGE(IF($B$5:$B$16=$B19,$C$5:$G$16))

The AVERAGE function will return the average of the cells that satisfies the IF condition.

  • Press Enter.

  • You will get the Average value of Experiment A for all Iterations.

  • Use the AutoFill option to fill in the table.

Final output of method 4 to use the AVERAGEIFS function for multiple columns


How to Calculate the Average of Multiple Columns Based on Multiple Conditions

Steps:

  • Select your entire dataset and press the keyboard shortcut Ctrl + T.
  • Check the box for My table has headers in the Create Table dialogue box.
  • Click on OK.

How to Calculate Average of Multiple Columns Based on Multiple Conditions in Excel

  • You will get the following output on your worksheet.

  • Select your table and go to the Data tab from the Ribbon.
  • Choose the From Table/Range option from the Get & Transform Data group.

  • The Power Query Editor window will open.

  • Right-click on the Experiment column.
  • Choose the Unpivot Other Columns option.

  • Your dataset will look like the following picture.

  • Click on the Close & Load option.

  • You will be redirected to your workbook with your modified dataset.

  • Create a table as shown in the image below.

  • Enter the following formula in cell H5.
=AVERAGEIFS(Table1__3[Value],Table1__3[Experiment Code],F5,Table1__3[Iteration],G5)

The AVERAGEIFS function will return the average of the cells of the Value column based on the specified conditions.

  • Press Enter.

  • You will get the Average of Experiment A for Iteration-1.

  • Use the AutoFill feature to get the rest of the outputs.

Final output of method 5 to use the AVERAGEIFS function for multiple columns


Practice Section

In the Excel Workbook, we have provided a Practice Section on the right side of the worksheet.

Practice section to use the AVERAGEIFS function for multiple columns


Download the Practice Workbook


Related Articles


<< Go Back to Excel AVERAGEIFS Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Zahid Hasan
Zahid Hasan

Zahid Hassan, BSc, Industrial and Production Engineering, Bangladesh University of Engineering and Technology, has worked with Exceldmy for 1.5 years. He has written 95+ articles for Exceldemy. He has worked as an Excel & VBA Content Developer. He also worked as a VBA Developer for the Template team. Currently, he is working as a Junior Software Developer for the Excel Add-in project. He is interested in Software Development, Python, VBA, VB.NET, and Data Science, expanding his expertise in... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo