Average If

sdoppke

Well-known Member
Joined
Jun 10, 2010
Messages
647
Code:
=AVERAGEIF(AND(VLOOKUP(D2,Data!$D$2:$BL$2078,42,0),VLOOKUP(D2,Data!$D$2:$BL$2078,43,0),VLOOKUP(D2,Data!$D$2:$BL$2078,44,0),VLOOKUP(D2,Data!$D$2:$BL$2078,45,0),VLOOKUP(D2,Data!$D$2:$BL$2078,46,0),VLOOKUP(D2,Data!$D$2:$BL$2078,47,0),VLOOKUP(D2,Data!$D$2:$BL$2078,48,0),VLOOKUP(D2,Data!$D$2:$BL$2078,49,0),VLOOKUP(D2,Data!$D$2:$BL$2078,50,0)),>0)

Hi everyone, can anyone figure out why my formula doesnt work? I am trying to averge all these vlookups that are greater than 0.

thanks a ton in advance :)

sd
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
=AVERAGEIF(AND(VLOOKUP(D2,Data!$D$2:$BL$2078,42,0),VLOOKUP(D2,Data!$D$2:$BL$2078,43,0),VLOOKUP(D2,Data!$D$2:$BL$2078,44,0),VLOOKUP(D2,Data!$D$2:$BL$2078,45,0),VLOOKUP(D2,Data!$D$2:$BL$2078,46,0),VLOOKUP(D2,Data!$D$2:$BL$2078,47,0),VLOOKUP(D2,Data!$D$2:$BL$2078,48,0),VLOOKUP(D2,Data!$D$2:$BL$2078,49,0),VLOOKUP(D2,Data!$D$2:$BL$2078,50,0)),>0)

Hi everyone, can anyone figure out why my formula doesnt work? I am trying to averge all these vlookups that are greater than 0.

thanks a ton in advance :)

sd
Try this array formula**:

=AVERAGE(IF(Data!D2:D2078=D2,IF(Data!AS2:BA2078>0,Data!AS2:BA2078)))

** 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 this array formula**:

=AVERAGE(IF(Data!D2:D2078=D2,IF(Data!AS2:BA2078>0,Data!AS2:BA2078)))

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


Thank you as allways for your help, worked perfect! Im not sure i understand the exact logic of the formula. Could you help me (learn to) tweak this:
Code:
=AVERAGE(IF(Data!D2:D2078=F2,IF(Data!BB2:BL2078>0,Data!BB2:BL2078)))
to include to set of lookups (not sure if lookup was the right word) so in other words i need to average all the above number plus these below:
Code:
=AVERAGE(IF(Data!D2:D2078=E2,IF(Data!BB2:BL2078>0,Data!BB2:BL2078)))

Hope that made sense. :biggrin:

sd
 
Upvote 0
Thank you as allways for your help, worked perfect! Im not sure i understand the exact logic of the formula. Could you help me (learn to) tweak this:
Code:
=AVERAGE(IF(Data!D2:D2078=F2,IF(Data!BB2:BL2078>0,Data!BB2:BL2078)))
to include to set of lookups (not sure if lookup was the right word) so in other words i need to average all the above number plus these below:
Code:
=AVERAGE(IF(Data!D2:D2078=E2,IF(Data!BB2:BL2078>0,Data!BB2:BL2078)))

Hope that made sense. :biggrin:

sd

I'm thinking this?
Code:
=AVERAGE(IF(Data!D2:D2078=F2,IF(Data!BB2:BL2078>0,Data!BB2:BL2078)),IF(Data!D2:D2078=D2,IF(Data!BB2:BL2078>0,Data!BB2:BL2078)))
 
Upvote 0
I'm thinking this?

=AVERAGE(IF(Data!D2:D2078=F2,IF(Data!BB2:BL2078>0,Data!BB2:BL2078)),IF(Data!D2:D2078=D2,IF(Data!BB2:BL2078>0,Data!BB2:BL2078)))
Yeah, like that but you have the same range listed twice.

Array entered**:

=AVERAGE(IF(Data!D2:D2078=D2,IF(Data!AS2:BA2078>0,Data!AS2:BA2078)),IF(Data!D2:D2078=F2,IF(Data!BB2:BL2078>0,Data!BB2:BL2078)))

** 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,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

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