# Reverse Horizontal Lookup From A Vertical Code

1. ## Reverse Horizontal Lookup From A Vertical Code

Guys, I need to do the following thing and I'm struggling with it a bit:
- I have a list of codes (lookup is based on that)
- For each code I need to find Top 5 largest values
- Display each value (top 5)
- Display a name (column name) matching to that value

Lookup needs to be reverse, since it's always going to be done bottom (value) up (heading).

See example attached. Any ideas would be much, much appreciated!

2. ## Re: Reverse Horizontal Lookup From A Vertical Code

See attached workbook. Essentially, I've copied down your list of codes to A17 (though these could be in a different sheet if you wanted), and put 1, 2, 3, 4 and 5 in B16, D16, F16 etc. Then this formula is in B17:

=LARGE(\$B3:\$O3,B\$16)

and this one in C17:

=INDEX(\$B\$2:\$O\$2,MATCH(B17,\$B3:\$O3,0))

This pair of formulae is then copied to columns D, F, H and J on row 17, and then B17 to K17 are copied down.

Hope this helps.

Pete

3. ## Re: Reverse Horizontal Lookup From A Vertical Code

see attached

Enter the code into the yellow cell and the names and values will populate with the top five for that code.

4. ## Re: Reverse Horizontal Lookup From A Vertical Code

Try this ...
In Q3
``Please Login or Register  to view this content.``
In R3
``Please Login or Register  to view this content.``
In S3
``Please Login or Register  to view this content.``
In T3
``Please Login or Register  to view this content.``
Drag/Fill all Down

5. ## Re: Reverse Horizontal Lookup From A Vertical Code

Originally Posted by npamcpp
see attached

Enter the code into the yellow cell and the names and values will populate with the top five for that code.
Guys, thank you all SO, SO much! npamcpp's solution fit my purpose best, because it combined everything into 1 formula (one for value lookup, and one where both value lookup and then name lookup were used) without touching source data. But I very, very much appreciate you taking the time out of your date to help! Thanks a million! :D

There are currently 1 users browsing this thread. (0 members and 1 guests)