Solved

Average IF

Posted on 2014-10-16
8
68 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
  • 4
  • 3
8 Comments
 
LVL 48

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
 
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now