
Originally Posted by
HSV
Something like this ?
Not "something" like this, it's EXACTLY like this!!! :D
But there's one "but" (as usual I guess). Here's the formula I adopted from yours (I put the value lookup formula INTO the product name lookup formula - merged them together):
=INDEX(DataTable!$DH$46:$IT$46,MATCH(LARGE(IF(OR(DataTable!$DH$46:$IT$46<>"TOTAL",DataTable!$DH$46:$IT$46<>"sTOTAL",DataTable!$DH$46:$IT$46<>"cTOTAL",DataTable!$DH$46:$IT$46<>"gTOTAL"),INDIRECT("DH"&MATCH($D$3,CodesColumn,0)&":"&"IT"&MATCH($D$3,CodesColumn,0)),""),ROW(DataTable!A46)),INDIRECT("DH"&MATCH($D$3,CodesColumn,0)&":"&"IT"&MATCH($D$3,CodesColumn,0)),0))
DataTable - name of the table where all data is
$DH$46:$IT$46 - headings line (under them data starts from row 47 onwards)
$D$3 - cell where code value being looked up is stored (code is a number from 1 to 1000)
CodesColumn - named range where all codes are stored on DataTable sheet (range heading is A46, data starts at A47)
For some reason this part "INDIRECT("DH"&MATCH($D$3,CodesColumn,0)&" returns a WRONG row number. For instance, let's say we're looking for a match for code 86. For some strange reason result returned for this is 76 (which then merged with DH giving DH76). Meaning after a lookup for 86, it returns that code 86 is in 76th row, and I honestly can't figure out why. As far as I understand the formula is looking for a row where code 86 is located, if so, it should return 122 (row 122), not 76.
Any ideas on how this might be solved? I'll play with LOOKUP in the meanwhile 
In any case, thank you so very much for your kind help and time!!
Bookmarks