Can Averageifs work with multiple criteria in the same column range?

The French Viking

New Member
Joined
Dec 9, 2010
Messages
2
Hi,

I've gained a ton of help from searching the forums here, but I can't find one on this pesky problem that I've narrowed down in a large formula:

I'm using the syntax Averageifs to calculate the average months of service in 'Data"!Q:Q based on two or more criteria in column 'Data'!O:O. I want to average the months of service for those who left the company due to "Unknown" and "ReturntoSchool."

Here's the part of a large formula that is returning #DIV/0!:

=AVERAGEIFS('Data'!Q:Q,'Data'!O:O,"Unknown",'Data'!O:O,"ReturntoSchool")

Again, this is part of a large formula with other criteria, but if I use more than one criteria for the same range I get the #DIV/0! error message. Have I hit a road block?

Thanks for reading and helping!
 
Thanks for the sample.

C2, copied across to D2, and down:

=AVERAGEIFS(F$2:F$44,$E$2:$E$44,">="&$A2,$E$2:$E$44,"<="&$B2)
 
Upvote 0

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.
Thank you so much! All I had to do was replace the comma's by a semicolon and it worked like a charm! This is more or less what I was trying before but in Excels instructions it looked like every second argument needed to be between [] after a semicolon and thats why it didn't work apparently. You handled it much smarter though. I inserted an extra column between A and B before containing the other value and added three arguments but in this way its easier since I can even use it if I want to calculate multiple day averages other than three day averages in the future for my data. Vriendelijk bedankt!
 
Upvote 0
Thank you so much! All I had to do was replace the comma's by a semicolon and it worked like a charm! This is more or less what I was trying before but in Excels instructions it looked like every second argument needed to be between [] after a semicolon and thats why it didn't work apparently. You handled it much smarter though. I inserted an extra column between A and B before containing the other value and added three arguments but in this way its easier since I can even use it if I want to calculate multiple day averages other than three day averages in the future for my data. Vriendelijk bedankt!

Graag gedaan. Thanks for providing feedback.
 
Upvote 0
You need to switch to something like...

Control+shift+enter, not just enter:
Code:
=AVERAGE(IF(ISNUMBER(MATCH(Data!O2:O2000,{"Unknown","ReturntoSchool"},0)),
     Data!Q2:Q2000))

Code:
=LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,
    AVERAGE(IF(ISNUMBER(MATCH(Data!O2:O2000,{"Unknown","ReturntoSchool"},0)),
      Data!Q2:Q2000))))
The latter avoids #DIV/0! when there is no match...

I was having a similar problem.. I had to search everywhere to find the solution, until I came here and I must say "Sir you have my respect". :):) Amazing!
 
Upvote 0

Forum statistics

Threads
1,224,570
Messages
6,179,611
Members
452,931
Latest member
The Monk

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
Back
Top