+ Reply to Thread
Results 1 to 4 of 4

Lookup in an "area" of multiple columns/rows

  1. #1
    Registered User
    Join Date
    01-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Lookup in an "area" of multiple columns/rows

    Hi All,

    I am working on an educational game for a classroom but I am having an issue with an area lookup. I spent hours searching for a way to do this yesterday but turned up nothing.

    AS per the below table, I essentially need a reverse index/match. Instead of typing in UK and 1910 and getting "6", I want to type in "6" and get "UK, 1910".

    The idea is that I will have a random number generator - between 1 and 16 (it's actually 1 and 500 in the real game) and when a number is generated it returns the country and date as per the below. Because lookup/index/vlookup etc all seem to only return the value of the first column or row, I'm at a loss on how to make this work. Any ideas?


    USA UK AUST CANADA
    1900 1 5 9 13
    1910 2 6 10 14
    1920 3 7 11 15
    1930 4 8 12 16

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup in an "area" of multiple columns/rows

    Try this...

    With your data in the range A1:E5.

    A10 = some lookup number like 6

    For the year number:

    =SUMPRODUCT((B2:E5=A10)*A2:A5)

    For the country:

    Array entered**:

    =INDEX(1:1,MAX(IF(B2:E5=A10,COLUMN(B2:E5))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    01-15-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Lookup in an "area" of multiple columns/rows

    Mate that's absolutely perfect. Exactly what I wanted. I really appreciate your assistance! That's solved the issue perfectly.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup in an "area" of multiple columns/rows

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1