?
Solved

Adding 2nd criteria for AverageIf Excel Formula

Posted on 2014-01-06
2
Medium Priority
?
429 Views
Last Modified: 2014-01-06
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
Comment
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
  • Learn & ask questions
2 Comments
 
LVL 85

Accepted Solution

by:
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

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question