Solved

Average IF

Posted on 2014-10-16
8
73 Views
Last Modified: 2014-10-16
Hi,

Im getting a #DIV/0 on the below formula

=AVERAGEIFS(WinLoss!R:R,WinLoss!BC:BC,"Yes",WinLoss!BA:BA,"Yes",WinLoss!F:F,"<>Renew",WinLoss!W:W,"Lost",WinLoss!W:W,"Cancelled")

Can anyone see why?

Thanks
0
Comment
Question by:Seamus2626
[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
  • 4
  • 3
8 Comments
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 40384012
Hi,

have you tested what the Help says

If average_range is a blank or text value, AVERAGEIFS returns the #DIV0! error value.
If cells in average_range cannot be translated into numbers, AVERAGEIFS returns the #DIV0! error value.
If there are no cells that meet all the criteria, AVERAGEIFS returns the #DIV/0! error value.


Regards
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 40384067
WinLoss!W:W,"Lost",WinLoss!W:W,"Cancelled"

Those last two can't both be true at once.
0
 

Author Comment

by:Seamus2626
ID: 40384082
They can be true, in terms of the data, we can have cancelled and lost, which is what im looking for, must the structure of the IF change?

Thanks
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 40384094
I mean one row cannot match both criteria, so you will never get any matches, hence your DIV/0 problem. You would need either SUMIFS / COUNTIFS or use an array version like:
=AVERAGE(IF((WinLoss!BC1:BC1000="Yes")*(WinLoss!BA1:BA1000="Yes")*(WinLoss!F1:F1000<>"Renew")*((WinLoss!W1:W1000="Lost")+(WinLoss!W1:W1000="Cancelled")),WinLoss!R1:R1000))
which is entered with Ctrl+Shift+Enter. Note: do NOT use entire column references with this formula!
0
 

Author Closing Comment

by:Seamus2626
ID: 40384099
I get it now!

Out of interest, why cant entire column reference be used?
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 40384105
Because it will make the formula calculate really slowly.
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 40384108
BTW, you could also use:

=SUM(SUMIFS(WinLoss!R:R,WinLoss!BC:BC,"Yes",WinLoss!BA:BA,"Yes",WinLoss!F:F,"<>Renew",WinLoss!W:W,{"Lost","Cancelled"}))/SUM(COUNTIFS(WinLoss!BC:BC,"Yes",WinLoss!BA:BA,"Yes",WinLoss!F:F,"<>Renew",WinLoss!W:W,{"Lost","Cancelled"}))
0
 

Author Comment

by:Seamus2626
ID: 40384113
That all makes sense, thanks Rory!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

749 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