+ Reply to Thread
Results 1 to 4 of 4

How to lookup value in table and return column header

  1. #1
    Forum Contributor
    Join Date
    07-01-2010
    Location
    Niles, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    137

    How to lookup value in table and return column header

    I have a sheet with a table in it. The table is in cells B1:F9. I also have a list of names in cells K2:K9. What I'd like to do is in cells L2:L9 is have a formula that would look up the names in column K in the table and if it finds it then return the column Header it found it in. I've attached a sample workbook.

    Hopefully I uploaded the file correct.

    Thanks in advance
    Excel 2010
    Attached Files Attached Files

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

    Re: How to lookup value in table and return column header

    Put in L2

    =IFERROR(INDEX($B$1:$F$1,MOD(SMALL(IF($B$2:$F$9=$K2,(ROW($B$2:$F$9)-ROW($B$2)+1)*10^5+COLUMN($B$2:$F$9)-COLUMN($B$2)+1),COUNTIF($K$2:K2,K2)),10^5)),"")

    and press all together CTRL+SHIFT+ENTER button (array formula style), and then copied down

  3. #3
    Forum Contributor
    Join Date
    07-01-2010
    Location
    Niles, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: How to lookup value in table and return column header

    I don't know how you did it but this is perfect. Thanks you so much.

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: How to lookup value in table and return column header

    This is shorter

    =INDEX(B$1:F$1,MAX(IF($B$2:$F$9=K2,COLUMN(B$1:F$1)-COLUMN(B$1)+1)))
    Array formula, use Ctrl-Shift-Enter
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

+ 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] Find specific value in table and return header row and header column value
    By nelwan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-30-2013, 01:35 AM
  2. [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
  3. Replies: 4
    Last Post: 03-13-2013, 12:38 PM
  4. Lookup value, return column header
    By jvp123 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-28-2012, 10:50 AM
  5. Replies: 5
    Last Post: 12-24-2011, 12:16 PM
  6. Lookup Row, Return Column Header
    By matt4003 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-22-2010, 07:43 AM
  7. [SOLVED] Lookup Value in Range/Array and Return Column Header Value
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2010, 08:17 AM
  8. Replies: 3
    Last Post: 06-16-2006, 02:10 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