AVERAGEIFS giving #DIV/0

sfran

New Member
Joined
Mar 9, 2021
Messages
26
Office Version
  1. 2016
Platform
  1. Windows
Hello, I'm trying to do an average of days (column D) based on criteria in column F. Column F can be several inputs, but I only want to use it if the cell contains "Investigating", "RC Identified" or "Pending Fix Verification".

When I use the AVERAGEIFS function individually for each of these, it provides the correct response. However when I use multiple criteria, I get a #DIV/0. The formula I am using is:

=AVERAGEIFS(D:D,F:F,"Investigating",F:F,"RC Identified",F:F,"Pending Fix Verification")


Any insight would be appreciated.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
73,310
Office Version
  1. 365
Platform
  1. Windows
You're formula is treating the criteria as an AND rather than an OR, try it like
Excel Formula:
=SUM(SUMIFS(D:D,F:F,{"Investigating","RC Identified","Pending Fix Verification"}))/SUM(COUNTIFS(F:F,{"Investigating","RC Identified","Pending Fix Verification"}))
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
63,320
Office Version
  1. 365
Platform
  1. Windows
That will always be the case, because the multiple criteria in AVERAGEIFS are ALWAYS treated as AND conditions, not OR conditions.
If it impossible for values in column F to equal all three values at the exact same time, so you will always get zero matches.

One way to do it ls like this:
Excel Formula:
=(SUMIF(F:F,"Investigating",D:D)+SUMIF(F:F,"RC Identified",D:D)+SUMIF(F:F,"Pending Fix Verification",D:D))/(COUNTIF(F:F,"Investigating")+COUNTIF(F:F,"RC Identified")+COUNTIF(F:F,"Pending Fix Verification"))

EDIT: Just see Fluff posted as I was working up the formula. His formula is a little shorter than mine!
 

sfran

New Member
Joined
Mar 9, 2021
Messages
26
Office Version
  1. 2016
Platform
  1. Windows
Thank you... that fixed it!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
73,310
Office Version
  1. 365
Platform
  1. Windows
Not sure which of us your talking to, but glad we could help & thanks for the feedback
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,309
Messages
5,836,572
Members
430,438
Latest member
David Gr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top