# AVERAGEIFS giving #DIV/0

#### sfran

##### New Member
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
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

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
Thank you... that fixed it!

#### Fluff

##### MrExcel MVP, Moderator
Not sure which of us your talking to, but glad we could help & thanks for the feedback

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.

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.

### Which adblocker are you using?

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

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