Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Adding 2nd criteria for AverageIf Excel Formula

Posted on 2014-01-06
Medium Priority
439 Views
Hello experts,

I'm using AVERAGEIF function to return the average of all the cells in a range that meet a given criteria.

I need to add a 2nd condition to the formula, but the problem is that the 2nd condition is not related to the first one, and hence it cannot be combined with it.

So, what I'm looking for is actually the following:

AverageIf (Condition 1 is met, Condition 2 is met, Average_Range*)

* Average_range is the actual set of cells to average.

I'm attaching the worksheet that has the AVERAGEIF formula in the hope it will better explain what I'm trying to achieve.
AverageIf-Sample-Data.xlsx
0
Question by:Mehawitchi
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 85

Accepted Solution

Rory Archibald earned 2000 total points
ID: 39759362
I think you just mean:

=AVERAGEIFS(INPUT!\$G\$2:\$G\$1670,INPUT!\$K\$2:\$K\$1670,\$E5,INPUT!\$I\$2:\$I\$1670,F\$2)

This will return errors if there are no matching data, so you may want to add an IFERROR to return either "" or 0:

=IFERROR(AVERAGEIFS(INPUT!\$G\$2:\$G\$1670,INPUT!\$K\$2:\$K\$1670,\$E5,INPUT!\$I\$2:\$I\$1670,F\$2),"")
0

Author Closing Comment

ID: 39759725
Brilliant!
Thank you Rory - You're really Genius!!
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
###### Suggested Courses
Course of the Month9 days, 16 hours left to enroll