Averageifs + "or", possible to do somehow?

Jennifre

Board Regular
Joined
Jan 11, 2011
Messages
160
I need to average cells which are labeled in a different column. Combining the averageifs function I think does not work with "or" criteria, so I tried this [but it's not working].

Is there a way to do this?

My effort:
=AVERAGE(IF(OR(DG2:DG1364=1212)+(DG2:DG1364=1222)),DJ2:DJ1364)

So I need to average column DJ, only for the rows whose DG column values equal 1212 or 1222. I need to use "or" not "and".

Thank you...!
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try the following formula, which needs to be confirmed with CONTROL+SHIFT+ENTER...

=AVERAGE(IF(ISNUMBER(MATCH(DG2:DG1364,{1212,1222},0)),DJ2:DJ1364))
 
Upvote 0
I need to average cells which are labeled in a different column. Combining the averageifs function I think does not work with "or" criteria, so I tried this [but it's not working].

Is there a way to do this?

My effort:
=AVERAGE(IF(OR(DG2:DG1364=1212)+(DG2:DG1364=1222)),DJ2:DJ1364)

So I need to average column DJ, only for the rows whose DG column values equal 1212 or 1222. I need to use "or" not "and".

Thank you...!
You were pretty close. Just remove the OR:

Array entered**:

=AVERAGE(IF((DG2:DG1364=1212)+(DG2:DG1364=1222),DJ2:DJ1364))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.
 
Upvote 0

Forum statistics

Threads
1,223,693
Messages
6,173,877
Members
452,536
Latest member
Chiz511

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