+ Reply to Thread
Results 1 to 6 of 6

Return the column header by searching for a specified value in a row

  1. #1
    Registered User
    Join Date
    09-25-2014
    Location
    Connecticut
    MS-Off Ver
    2010
    Posts
    4

    Return the column header by searching for a specified value in a row

    I need to look for a specific value in a row and return the name of the column

    I'm trying to write a formula to look for "M1" in my table by row using student # and return the name of the column header.

    Please see my sheet below. I appreciate any help. Thank you!!
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Return the column header by searching for a specified value in a row

    =INDEX($C$2:$Q$2,MATCH("m1",INDEX($C$3:$Q$75,MATCH(15,$A$3:$A$75,0),0),0)) returns zumba for student 15
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    09-25-2014
    Location
    Connecticut
    MS-Off Ver
    2010
    Posts
    4

    Re: Return the column header by searching for a specified value in a row

    Thank you, thank you. I attempted the index function on my own and failed. This works great!

  4. #4
    Registered User
    Join Date
    09-25-2014
    Location
    Connecticut
    MS-Off Ver
    2010
    Posts
    4

    Re: Return the column header by searching for a specified value in a row

    One last thing, what should I put in the formula to prevent it from returning #N/A when I copy down the formula? I just want a blank cell if there's no match.

    Thank you again.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Return the column header by searching for a specified value in a row

    wrap it in iferror()
    =iferror(INDEX($C$2:$Q$2,MATCH("m1",INDEX($C$3:$Q$75,MATCH(15,$A$3:$A$75,0),0),0)),"")

  6. #6
    Registered User
    Join Date
    09-25-2014
    Location
    Connecticut
    MS-Off Ver
    2010
    Posts
    4

    Re: Return the column header by searching for a specified value in a row

    Thank you again!

+ 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. Return column header based on column criteria and number value
    By bwill22 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-07-2014, 07:33 PM
  2. [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
  3. Replies: 4
    Last Post: 03-13-2013, 12:38 PM
  4. Return value under column header
    By milty456 in forum Excel General
    Replies: 2
    Last Post: 09-28-2012, 11:13 PM
  5. Searching for a cell value, return column
    By mdsickler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2011, 02:46 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