+ Reply to Thread
Results 1 to 5 of 5

lookup 2 values and return one

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2010
    Posts
    8

    lookup 2 values and return one

    I need to lookup 2 values in a spreadsheet and return one value. I attached an example -


    From the MAIN tab, the stunum is the lookup value...I need to go to the DATA tab and look for the stunum AND the test # and return the corresponding test grade.

    This is a tiny example...my real data contains thousands of rows of data.

    Please help!
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: lookup 2 values and return one

    One way:

    =INDEX(Data!$D$2:$D$7,MATCH($B2&SUBSTITUTE(C$1," Score",""),Data!$B$2:$B$7&Data!$C$2:$C$7,0))

    Array Entered with Ctrl-Shift-Enter rather than just Enter


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-08-2013
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: lookup 2 values and return one

    Awesome...that did work for Test # 1 but I'm not as advanced as you...can you show me the same formula for Test 2 and I will see if I can figure out how you are building this formula?
    I'm not quite following all of it yet....thank you so much!!!!

    Also what is the difference between just "enter" and CTRL-SHIFT-ENTER?

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: lookup 2 values and return one

    Thanks for the rep.

    To get Test #2, just drag the formula across. It's just removing " Score" from the column header.

    it's an Array Formula and needs to be committed with Ctrl-Shift-Enter rather than just Enter. However, you only need to put the first formula in, commit it, and then drag across and down.

    Regards, TMS

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: lookup 2 values and return one

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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