+ Reply to Thread
Results 1 to 9 of 9

Formula to lookup a value in a row on a spreadsheet that matches name and date

  1. #1
    Registered User
    Join Date
    04-17-2007
    Posts
    17

    Formula to lookup a value in a row on a spreadsheet that matches name and date

    Hello! I am looking for help with a formula which will return a value from a worksheet based on the name and date in the current worksheet. So if Sheet1!Name = Sheet2!Name and Sheet1!Date = Sheet2!Date, then return Sheet1!Hours. Can someone please help? Thank you! Jenn

  2. #2
    Registered User
    Join Date
    04-17-2007
    Posts
    17

    Re: Formula to lookup a value in a row on a spreadsheet that matches name and date

    To clarify:
    Sheet1:
    b5 = name
    d4 = date

    Sheet2:
    b2 = name
    x1:id1 = dates
    x2:id2 = value

    Need to lookup Sheet1!B5 on Sheet2!B2 and where the Sheet1!D4 date matches the date in the range Sheet2!x1:id1 return the corresponding value in Sheet2!x2:id2. I hope this helps. Thank you!

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Formula to lookup a value in a row on a spreadsheet that matches name and date

    It would be easier if you supplied a sample workbook, but giv this a try...

    =if(and(Sheet1!Name=Sheet2!Name,Sheet1!Date=Sheet2!Date),Sheet1!Hours,"")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    04-17-2007
    Posts
    17

    Re: Formula to lookup a value in a row on a spreadsheet that matches name and date

    That worked great! Thank you so much and next time I will load a sample.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Formula to lookup a value in a row on a spreadsheet that matches name and date

    You'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, (see point 2 below)

  6. #6
    Registered User
    Join Date
    04-17-2007
    Posts
    17

    Re: Formula to lookup a value in a row on a spreadsheet that matches name and date

    It appears only to work where the first date on Sheet2 is the same as the first date on Sheet1. I can't see to figure out how to attach a sample. THANK YOU!
    Here is what I have loaded

    A B C D
    1 Employee Name 12/1/2012 1/1/2013 2/1/2013 3/1/2013 4/1/2013 5/1/2013 6/1/2013 7/1/2013 8/1/2013
    1 First =IF(AND(Sheet1!$B$2=Sheet2!$B$2,Sheet1!$C$1:$T$1=Sheet2!C1),Sheet1!$C$2:$T$2,"")

    Sheet 1:
    A B C D
    10/1/2012 11/1/2012 12/1/2012 1/1/2013 2/1/2013 3/1/2013 4/1/2013 5/1/2013 6/1/2013 7/1/2013 8/1/2013 9/1/2013
    First 59.00 59.00 59.00 59.00 59.00 59.00 59.00 59.00 - 47.75 193.75 237.40

    Any help you can provide would be great!
    Attached Files Attached Files
    Last edited by jsclark; 06-15-2013 at 07:06 PM. Reason: Uploading sample

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Formula to lookup a value in a row on a spreadsheet that matches name and date

    It appears only to work where the first date on Sheet2 is the same as the first date on Sheet1
    Thats exactly what you asked for?

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Formula to lookup a value in a row on a spreadsheet that matches name and date

    Try this in C2, copied down and across...
    =INDEX(Sheet1!$B$1:$T$2,MATCH(Sheet2!$B2,Sheet1!$B$1:$B$2,0),MATCH(Sheet2!C$1,Sheet1!$B$1:$T$1,0))

    Having seen your file, what you initially requested is not (I think) what you actually need

  9. #9
    Registered User
    Join Date
    04-17-2007
    Posts
    17

    Re: Formula to lookup a value in a row on a spreadsheet that matches name and date

    And SOLVED! Thank you!

+ 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