+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Look at row, find a value, report column header

  1. #1
    Registered User
    Join Date
    07-06-2009
    Location
    Utah
    MS-Off Ver
    Excel 2007
    Posts
    3

    Smile Look at row, find a value, report column header

    I want to look up a specific value in a row and find the value and report the column header. I am wondering if there is a relativly simple way to do this. I have a schedule listed with the times on the left, the students across the top, and the teachers listed inside the table. I would like to have it find the teacher and tell me which student they will have during that hour:

    Mike Steve Sam
    1 Mr Still Mrs Tam Ms Stweart
    2 Mr Fong Mr Dave Mrs Tam
    3 Mrs Tam Ms Stweart Mr Fong

    So, at 1:00, I want it to look up Mrs Tam and tell me that she will teach Steve at that time. At 3, I want it to report that Mr Fong will teach Sam. If you need more details, let me know.
    Last edited by jdottdot; 07-09-2009 at 03:34 AM.

  2. #2
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Look at row, find a value, report column header

    It's certainly doable, there are many options for lookup functions, I'd just need to know what you mean by IT. You want IT to return values.

    Explain what IT is, and we'll get started.

    IE.
    List, chart, drop down box with names and times, user input in cells... mew mew mew.

    mew!
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Look at row, find a value, report column header

    You example is pretty specific, perhaps too specific, but this is one way to do it...
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    07-06-2009
    Location
    Utah
    MS-Off Ver
    Excel 2007
    Posts
    3

    Look at row, find a value, report column header

    My ultimate purpose is to exchange where the teacher names are and the student names are. I would like to have the Teacher Names as the Column Header and the times as the row header and have the resulting table tell me which student the teacher has at the specified time. I'm trying to set up a way of creating a student schedule table and from that create the teacher schedule table. Otherwise I'm doing it manually.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Look at row, find a value, report column header

    Ah, much simpler then...

    =IF(ISNUMBER(MATCH(G$1, $B2:$D2, 0)), INDEX($B$1:$D$1, MATCH(G$1, $B2:$D2, 0)), "-")
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-06-2009
    Location
    Utah
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Look at row, find a value, report column header

    Thank you SO much!!! That did exactly what I needed it to do. I ended up making a drop down menu to pick the teacher and then used the formula to have it create the teacher schedule. It works wonderfully! Here's a minor question that may be a little ignorant on my part. There are times that even when I input the correct information, the cells don't auto-populate. If I copy and paste the formula in the cell to the same cell, it will work. Do you know if there is a way to avoid this or a way to refresh the page so it will show the name?
    Last edited by jdottdot; 07-08-2009 at 01:09 AM.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Look at row, find a value, report column header

    Check your sheet options (I don't use 2007, so can't tell you where it is) and make sure Calculation is automatic. There's nothing weird about these sheet functions, so it must be something environmental.

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ 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