averageif - multiple criteria

clock245

New Member
Joined
Aug 17, 2008
Messages
21
This is definitely a simple question and i'm certain it's something that i'm overlooking in writing a formula, but say you have 5 values:

A1: 600
A2: 715
A3: 822
A4: 901
A5: 1001

B1: 600
B2: 950

I want to create an averageif formula. What i would like it do is to average if higher than 600, but lower than 950. So the formula i have is:
=AVERAGEIF($a$1:$a$5,"<="&B2). What am i missing for the second part -- greater than b1? For some odd reason i'm not typing the formula in correctly to get the right answer here - can anyone help
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
this is definitely a simple question and i'm certain it's something that i'm overlooking in writing a formula, but say you have 5 values:

A1: 600
a2: 715
a3: 822
a4: 901
a5: 1001

b1: 600
b2: 950

i want to create an averageif formula. What i would like it do is to average if higher than 600, but lower than 950. So the formula i have is:
=averageif($a$1:$a$5,"<="&b2). What am i missing for the second part -- greater than b1? For some odd reason i'm not typing the formula in correctly to get the right answer here - can anyone help


=(sumif(a1:a5,">="&b1)-sumif(a1:a5,">"&b2))/sumproduct((a1:a5>=b1)*(a1:a5<=b2))
 
Upvote 0
You could also try...

=AVERAGE(IF($A$1:$A$5>=B1,IF($A$1:$A$5<=B2,$A$1:$A$5)))

...confirmed with CONTROL+SHIFT+ENTER.
 
Upvote 0
Hello clock245, welcome to MrExcel.

I assume you are using Excel 2007 since AVERAGEIF function doesn't exist in earlier versions. For multiple criteria there is also an AVERAGEIFS function, in your scenario you can use that like this:

=AVERAGEIFS($A$1:$A$5,$A$1:$A$5,"<="&B2,$A$1:$A$5,">="&B1)
 
Upvote 0
Thanks all! I will use Mr. Houdini's formula - exactly what i was looking for. i've used it before, but i completely blanked on the formula (surprisingly i never looked past the =averageif on the autocomplete to recognize it - stupid me!)

Thanks again all!
 
Upvote 0
A bit of a thread dig - but was wondering if there's a way of getting an averageifs to use a multiple OR criteria, i.e. TRUE *or* FALSE.
 
Upvote 0
You probably can't use AVERAGEIFS for that but there are other ways.....how many criteria do you have, can you expand a little on what you want to do?
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,208
Members
448,554
Latest member
Gleisner2

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