Average function with multiple criteria

bgamach1

New Member
Joined
Apr 8, 2016
Messages
8
=IF(R8=5,AVERAGE(O3:O7)*0.96)

=IF(R8=7,AVERAGE(O3:O9)*0.96)

How do I combine these into one formula? I get #VALUE when I put =IF(R8=6,AVERAGE(O3:O8)*0.96),IF(R8=7,AVERAGE(O3:O9)*0.96)
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
You have a parenthesis in the wrong place, and are closing out the expression before the second IF.
Try:
Code:
=IF(R8=6,AVERAGE(O3:O8)*0.96,IF(R8=7,AVERAGE(O3:O9)*0.96))
Note, if neither condition is met, it will return FALSE unless you add the last optional false argument, i.e.
Code:
=IF(R8=6,AVERAGE(O3:O8)*0.96,IF(R8=7,AVERAGE(O3:O9)*0.96,"neither condition met"))
 
Last edited:
Upvote 0
Depends on a few other things. Maybe:

=AVERAGE(OFFSET(O3,0,0,R8))*0.96

but this doesn't handle cases where R8 might not be a value you want.
 
Last edited:
Upvote 0
=IF(R8=5,AVERAGE(O3:O7)*0.96)

=IF(R8=7,AVERAGE(O3:O9)*0.96)

How do I combine these into one formula? I get #VALUE when I put =IF(R8=6,AVERAGE(O3:O8)*0.96),IF(R8=7,AVERAGE(O3:O9)*0.96)

Maybe this:

=AVERAGE(O3:INDEX($O:$O,IF(R8=5,7,IF(R8=7,9))))*0.96

Markmzz
 
Upvote 0

Forum statistics

Threads
1,215,339
Messages
6,124,363
Members
449,155
Latest member
ravioli44

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