Solved

Average IF

Posted on 2014-10-16
8
75 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 51

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

 
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

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!

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

729 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