+ Reply to Thread
Results 1 to 2 of 2

Lookup item in table and get column heading

Hybrid View

  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    3

    Lookup item in table and get column heading

    I am having trouble with this look up. This sounds like an easy thing to do, but for some reason I cannot get this to work...

    Here is what I need...

    I have two worksheets. The frist one is the reference sheet. it looks something like:

    A B C
    1 Northeast South West
    2 PA TX CA
    3 MA OK OR
    4 NH LA WA

    The second spreadsheet has a number of columns. In column Q is a list of states (PA, MA, OK, etc.). In Column R I want to return the value of the column header (of the first spreadsheet) of the state from column Q. For example, if the state in Q1 is PA I want Northeast in R1. If the state in Q2 is TX then I want South in R2.

    Any help would be appreicated.


    Jason

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Lookup

    Assuming your original database is in Sheet1!A1:C4 and your list is in Sheet2 starting at Q2, then in R2:

    =INDEX(Sheet1!$A$1:$C$1,SUMPRODUCT((Sheet1!$A$2:$C$4=Q2)*COLUMN(Sheet1!$A$2:$C$4)-COLUMN(Sheet1!$A$2)+1))


    copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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