Search code examples
excelexcel-formulaexcel-2010excel-2007vba

Excel - Find a value in an array and return the value of the cell next to it


I have a table in which I want to search for "Item" in the whole Array of E1:X100 and return the value next to the match in the "Output" row.

As an example: I want to search for the Item "AC06" (marked yellow) in the whole rest of the sheet - find it in I8 and output the value in the cell next to it (marked green) to the cell C13.

See Example Table here

I experimented with an index match without success. One way to solve it would be of course to copy all of the Items and Descriptions under each other and do a Vlookup - this, however, is not the real Solution we need.


Solution

  • You need to nest some INDEX/MATCH function pairs.

    =INDEX(H:AC, MATCH(D10, INDEX(H:AC,0,MATCH(E10, H$4:AC$4, 0)), 0),MATCH(E10,H$4:AC$4,0)+1)
    

    =INDEX(H:AC, MATCH(D8, INDEX(H:AC,0,MATCH(E8, H$2:AC$2, 0)), 0),MATCH(E8,H$2:AC$2,0)+1)