How about this. Assuming following.
Looked data in
=Sheet2!A1
Column where to look
=Sheet1!A:A
6 columns to the left of this one
=Sheet1!B:G
Formula would be in Sheet2.
=AVERAGE(INDIRECT("B" & MATCH(A1, Sheet1!$A:$A, 0) & ":G" & MATCH(A1, Sheet1!$A:$A, 0)))
or
=IF(COUNTIF(Sheet1!$A:$A, A1), AVERAGE(INDIRECT("B" & MATCH(A1, Sheet1!$A:$A, 0) & ":G" & MATCH(A1, Sheet1!$A:$A, 0))), 0)
Juan Pablo G.
I can think of 2 ways...but neither are as efficient as I'd like.
I don't know the exact layout of your data but I'll assume your lookup range as A2:G2000 for example purposes, where you want to average B thru G columns when you a value to A.
1> Insert a column (probably normally hidden from view) with the formula: =ROW(A2) ->assuming A2 starts your lookup range. Based on this example say this is tossed into column H.
Instead of your Vlookup alone use: =Average(Indirect("B" & Vlookup(input,$A$2:$H$2000, 8 ,false) & ":G" & Vlookup(input, $A$2:$H$2000, 8, false)))
2>an average of 6 vlookups:
=(Vlookup(,,2,false) + Vlookup(,,3,false)..... + vlookup(,,7,false)) / 6
Hope that helps
Adam S.
Suppose your lookup table in cells A1:G6 is...
{1,4,15,12,25,22,11
;2,24,6,18,16,19,16
;3,7,8,11,8,21,21
;4,13,4,15,9,22,12
;6,7,23,22,10,15,24}
The array formula...
{=AVERAGE(VLOOKUP(2,$A$1:$G$5,{2,3,4,5,6,7},0))}
...will average the values in columns B:G on row 2
and return 16.5.
Note: Array formulas must be entered using the
Control+Shift+Enter key combination. The
outermost braces, {}, are not entered by you --
they're supplied by Excel in recognition of a
properly entered array formula.
Got me there. Nice formula