Solved

Average IF

Posted on 2014-10-16
8
71 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 49

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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
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 in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

825 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