+ Reply to Thread
Results 1 to 19 of 19

reverse lookup to get the row header

  1. #1
    Registered User
    Join Date
    04-25-2019
    Location
    world
    MS-Off Ver
    2018
    Posts
    8

    reverse lookup to get the row header

    Dear all,

    how can I get the name of the element in the row?

    thank you in advance.Capture.JPG
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: reverse lookup to get the row header

    In I2 then copied down.

    =IFERROR(INDEX($A$2:$A$7,MATCH($I$1,INDEX($B$2:$F$7,,MATCH($H2,$B$1:$F$1,0)),0)),"")
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 04-25-2019 at 03:51 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: reverse lookup to get the row header

    Welcome to the forum!

    In I2 copied down:

    =INDEX($A$2:$A$7,MATCH(1,OFFSET($A$2:$A$7,,MATCH(H2,$B$1:$F$1,0)),0))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,366

    Re: reverse lookup to get the row header

    Hi @AliGW your formula doesn't work because I see there are 2 criteria, namely columns header and values

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: reverse lookup to get the row header

    It works perfectly - did you test it? I did (see the final two columns below):

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    1
    P
    N
    L
    M
    MI
    1
    AliGW 1 AliGW 2
    2
    P1
    1
    6
    1
    6
    5
    P P1 P1 P2
    3
    P2
    2
    3
    6
    4
    9
    N P6 P6 P3
    4
    P3
    5
    2
    3
    5
    1
    L P1 P1 P6
    5
    P4
    3
    5
    4
    9
    6
    M P5 P5 P6
    6
    P5
    4
    4
    5
    1
    4
    MI P3 P3 P6
    7
    P6
    6
    1
    2
    2
    2
    Sheet: Sheet1

    J2: =INDEX($A$2:$A$7,MATCH(1,OFFSET($A$2:$A$7,,MATCH(H2,$B$1:$F$1,0)),0))
    K2: =INDEX($A$2:$A$7,MATCH(2,OFFSET($A$2:$A$7,,MATCH(H2,$B$1:$F$1,0)),0))
    Last edited by AliGW; 04-25-2019 at 04:29 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: reverse lookup to get the row header

    @Excelsar - if that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  7. #7
    Registered User
    Join Date
    04-25-2019
    Location
    world
    MS-Off Ver
    2018
    Posts
    8

    Re: reverse lookup to get the row header

    Thank you very much. It works fine.

  8. #8
    Registered User
    Join Date
    04-25-2019
    Location
    world
    MS-Off Ver
    2018
    Posts
    8

    Re: reverse lookup to get the row header

    Quote Originally Posted by kvsrinivasamurthy View Post
    In I2 then copied down.

    =IFERROR(INDEX($A$2:$A$7,MATCH($I$1,INDEX($B$2:$F$7,,MATCH($H2,$B$1:$F$1,0)),0)),"")
    Thank you very much. ıt works fine.

  9. #9
    Registered User
    Join Date
    04-25-2019
    Location
    world
    MS-Off Ver
    2018
    Posts
    8

    Re: reverse lookup to get the row header

    Quote Originally Posted by AliGW View Post
    Welcome to the forum!

    In I2 copied down:

    =INDEX($A$2:$A$7,MATCH(1,OFFSET($A$2:$A$7,,MATCH(H2,$B$1:$F$1,0)),0))
    Thank you very much. It works fine.

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: reverse lookup to get the row header

    No problem.

  11. #11
    Registered User
    Join Date
    04-25-2019
    Location
    world
    MS-Off Ver
    2018
    Posts
    8

    Re: reverse lookup to get the row header

    Dear kvsrinivasamurthy ,

    I was trying to understand how you build the formula and that's why I was trying to split it to it's components. I couldn't solve/understand some parts.
    Could you please split this formula to 4 parts in different columns for each component?
    I tried but I could not make it. For example; this part " INDEX($B$2:$F$7,," gives N/A.

    I was trying this:

    I2: MATCH($H2,$B$1:$F$1,0)
    J2: INDEX($B$2:$F$7) reads from I2
    K2: MATCH($I$1.. reads from j2
    L2: INDEX($A$2:$A$7 reads from k2

    The formula works fine, thank you again.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: reverse lookup to get the row header

    I suggest you remove the SOLVED tag, otherwise this request might go unanswered.

  13. #13
    Registered User
    Join Date
    04-25-2019
    Location
    world
    MS-Off Ver
    2018
    Posts
    8

    Re: reverse lookup to get the row header

    I did it, thank you...

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: reverse lookup to get the row header

    What exactly are you trying to do now?

  15. #15
    Registered User
    Join Date
    04-25-2019
    Location
    world
    MS-Off Ver
    2018
    Posts
    8

    Re: reverse lookup to get the row header

    I am trying to learn how to build that formula.
    For this I needed to split it to small pieces.

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: reverse lookup to get the row header

    You can't split it into bits and expect those bits to work on their own. Do you want a breakdown of what each section does?

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: reverse lookup to get the row header

    In the case of mine:

    =INDEX($A$2:$A$7,MATCH(1,OFFSET($A$2:$A$7,,MATCH(H2,$B$1:$F$1,0)),0))

    INDEX($A$2:$A$7, - this tells Excel where to find the result data - the range from which the results will come.

    MATCH(1,OFFSET($A$2:$A$7,,MATCH(H2,$B$1:$F$1,0)),0) - this bit tells Excel which row of the results data range to return.

    MATCH(1, - this bit tells Excel that we are looking for the number 1 in the lookup range.

    OFFSET($A$2:$A$7,, - this bit tells Excel that the range we are looking for will be offset from the result data range by ...

    MATCH(H2,$B$1:$F$1,0)) - ... the number of columns based on the position of the value of H2 in the range $B$1:$F$1.

    0) - finally, this bit tells Excel that we are looking for an exact match.

  18. #18
    Registered User
    Join Date
    04-25-2019
    Location
    world
    MS-Off Ver
    2018
    Posts
    8

    Re: reverse lookup to get the row header

    Dear AliGW

    Thank you very much.

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: reverse lookup to get the row header

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Reverse Lookup to Return Column Header (Date)
    By jeversf in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-30-2013, 12:27 PM
  2. [SOLVED] Reverse Lookup?
    By West1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-02-2013, 07:20 AM
  3. Match/Index/Lookup - Searching From Bottom to Top (A reverse lookup maybe)
    By Neutralizer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-02-2013, 03:55 AM
  4. Need Help For Reverse V-Lookup
    By Abhijeetsjadhav in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-23-2013, 06:03 PM
  5. Reverse 2-D lookup
    By Adam Beauregard in forum Excel General
    Replies: 2
    Last Post: 10-30-2011, 06:19 PM
  6. Reverse Lookup help
    By bras1l in forum Excel General
    Replies: 8
    Last Post: 10-30-2006, 04:07 PM
  7. Reverse Lookup help
    By bras1l in forum Excel General
    Replies: 1
    Last Post: 10-30-2006, 02:13 PM
  8. Reverse lookup
    By Rick in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-17-2006, 02:35 PM

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