
Originally Posted by
Domenic
Here's another way...
Assuming that A1:F4 contains two 3-column tables...
B10, copied to C10:
=VLOOKUP($A10,IF($A$1:$A$4=$A10,$A$1:$C$4,$D$1:$F$4),COLUMNS($B$10:B10)+1,0)
...where A10 contains your lookup value. If you have a number of columns, you can add to your IF statement. Alternatively, assuming that A1:R4 contains six 3-column tables...
B10, copied to C10:
=VLOOKUP($A10,OFFSET($A$1:$R$4,0,MATCH(TRUE,COUNTIF(OFFSET($A$1:$R$4,0,{0,3,6,9,12,15},4,1),$A10)>0,0)*3-3,4,3),COLUMNS($B$10:B10)+1,0)
...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
Adjust the range and array constant accordingly. So, for example, if A1:AA4 contains nine 3-column tables, change $A$1:$R$4 to $A$1:$AA$4, and {0,3,6,9,12,15} to {0,3,6,9,12,15,18,21,24}. Also, if the number of rows for your tables increase, change the reference accordingly. So, for example, if instead of 4 rows you have 10 rows, change this part *3-3,4,3) to *3-3,10,3). The 10 (in red) refers to the number of rows, and the 3 (in blue) refers to how many columns each table contains.
Hope this hleps!
Bookmarks