+ Reply to Thread
Results 1 to 6 of 6

Match on Name and Date Fields

  1. #1
    Registered User
    Join Date
    07-07-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Match on Name and Date Fields

    Firstly I've tried Googling a response for days, but as I haven't been able to find anything I've signed up to post my first ever support request.

    I have two sets of data, first set contains records from a timesheeting system, including:
    Name Date

    Where each name will be repeated mulitple times each day worked.

    Second set of data relates to the invoices for the same resources, and includes:
    Name Invoice No Date From Date To

    And may include multiple invoices for the same resource.

    What I'm trying to do is determine for each record in the timesheeting system (adding a column next to this data) what is the associated invoice number? A simple VLOOKUP returns the first match it finds, however if there are multiple invoices for the same person, I want to return the correct number based on the date fields.

    I hope I've explained this well. I've attached a simple spreadsheet to outline what is required.Book1.xlsx

  2. #2
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Match on Name and Date Fields

    Not sure, but if you are looking to total the number of invoices,
    then perhaps something like this will do ..
    In C2, copied down:
    =SUMPRODUCT(($H$2:$H$4=$A2)*($J$2:$J$4<=$B2)*($K$2:$K$4>=$B2),$I$2:$I$4)
    ------------------------------
    Any worth? If yes, hit the little star at the bottom left of my response

  3. #3
    Registered User
    Join Date
    07-07-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Match on Name and Date Fields

    Thanks for your reply Max, however I'm looking to just return the corresponding invoice number for each timesheet entry, not total the number of invoices.

  4. #4
    Valued Forum Contributor
    Join Date
    09-07-2006
    Posts
    520

    Re: Match on Name and Date Fields

    Sorry, I don't have any other idea to offer you. If nobody else pops by your thread, try another post in programming forum

  5. #5
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    503

    Re: Match on Name and Date Fields


  6. #6
    Registered User
    Join Date
    07-07-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Match on Name and Date Fields

    FYI I was able to get the correct formula using INDEX and SUMPRODUCT:

    =INDEX($E$2:$H$5,SUMPRODUCT((A2=$E$2:$E$5)*(B2>=$G$2:$G$5)*(B2<=$H$2:$H$5)*ROW($F$2:$F$5)-ROW($F$1)+1)-1,2)

    Where Table1 data was located in cells A2:C7 and table2 data was located in cells E2:H5.

    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