Average IF with multiple OR criteria

genepaton

New Member
Joined
Jun 1, 2011
Messages
37
I tried writing an OR multiple criteria to work out averages from a column of data, but seem to be getting different results to manual calculations.
Can anyone assist in writing a single formula for the following multiple ones?

{=IF(B62=0,"0",AVERAGE(IF((Sheet1!H10:H65536="ARP"),Sheet1!I10:I65536)))/1440}
{=IF(B62=0,"0",AVERAGE(IF((Sheet1!H10:H65536="ART"),Sheet1!I10:I65536)))/1440}
{=IF(B62=0,"0",AVERAGE(IF((Sheet1!H10:H65536="AP"),Sheet1!I10:I65536)))/1440}
{=IF(B62=0,"0",AVERAGE(IF((Sheet1!H10:H65536="AH"),Sheet1!I10:I65536)))/1440}

B62 is just a COUNTIF formula to see if there's any "A*" entries in the range H10:H65536.

I tried {=AVERAGE(IF(OR(Sheet1!H10:H65536="ARP",Sheet1!H10:H65536="ART",Sheet1!H10:H65536="AP",Sheet1!H10:H65536="AH"),Sheet1!I10:I65536))/1440}
But got different results.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
I tried writing an OR multiple criteria to work out averages from a column of data, but seem to be getting different results to manual calculations.
Can anyone assist in writing a single formula for the following multiple ones?

{=IF(B62=0,"0",AVERAGE(IF((Sheet1!H10:H65536="ARP"),Sheet1!I10:I65536)))/1440}
{=IF(B62=0,"0",AVERAGE(IF((Sheet1!H10:H65536="ART"),Sheet1!I10:I65536)))/1440}
{=IF(B62=0,"0",AVERAGE(IF((Sheet1!H10:H65536="AP"),Sheet1!I10:I65536)))/1440}
{=IF(B62=0,"0",AVERAGE(IF((Sheet1!H10:H65536="AH"),Sheet1!I10:I65536)))/1440}

B62 is just a COUNTIF formula to see if there's any "A*" entries in the range H10:H65536.

I tried {=AVERAGE(IF(OR(Sheet1!H10:H65536="ARP",Sheet1!H10:H65536="ART",Sheet1!H10:H65536="AP",Sheet1!H10:H65536="AH"),Sheet1!I10:I65536))/1440}
But got different results.
Try it like this.

Put the criteria in a range of cells:
  • A2 = ARP
  • A3 = ART
  • A4 = AP
  • A5 = AH
Array entered**:

=IF(B62=0,0,AVERAGE(IF(ISNUMBER(MATCH(Sheet1!H10:H65536,A2:A5,0)),Sheet1!I10:I65536))/1440)

** 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
Try it like this.

Put the criteria in a range of cells:
  • A2 = ARP
  • A3 = ART
  • A4 = AP
  • A5 = AH
Array entered**:

=IF(B62=0,0,AVERAGE(IF(ISNUMBER(MATCH(Sheet1!H10:H65536,A2:A5,0)),Sheet1!I10:I65536))/1440)

** 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.

Once again Mr Valko, you save the day!
Thanks, and i actually was going to mention a range of reference cells! Just to demonstrate that i am learning from your wisdom :)
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,547
Members
452,925
Latest member
duyvmex

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