+ Reply to Thread
Results 1 to 5 of 5

How to return the content of cell 1 in cell 3 if content in cell 2 is looked up?

  1. #1
    Registered User
    Join Date
    06-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    How to return the content of cell 1 in cell 3 if content in cell 2 is looked up?

    my problem is as follows:
    I have a set of data with headings in row 1, say A1:P1.
    I then have numbers in row 2, A2:P2.
    What formula should I enter in another cell, say Z1, that look up a specific number in A2:P2, and if the cell containing the number is A2, then Z1 will return the heading in A1?

    Many thanks

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: How to return the content of cell 1 in cell 3 if content in cell 2 is looked up?

    in AA1 you can place =indirect(char(64+match(z1,"a2:p2",0))&"1"). In Z1 you will enter the desired number so I chose AA1 to display the result

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How to return the content of cell 1 in cell 3 if content in cell 2 is looked up?

    =INDEX(A1:P1,MATCH(AA1,A2:P2,0))

    where AA1 contains the number you are trying to find in A2:P2
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    06-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: How to return the content of cell 1 in cell 3 if content in cell 2 is looked up?

    thanks for the reply
    I entered the number in A2 into Z1 and =indirect(char(64+match(z1,a2:p2,0))&"1") without "" around a2:p2 in AA1 as excel says there is error.
    The outcome is 0 instead of the A1 heading in AA1.
    By the way can I ask what does the 64 imply?

  5. #5
    Registered User
    Join Date
    06-28-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: How to return the content of cell 1 in cell 3 if content in cell 2 is looked up?

    Wow, thanks Ace_XL, it works perfectly!

+ 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