+ Reply to Thread
Results 1 to 7 of 7

Finding value of date within date range + one other criteria

  1. #1
    Registered User
    Join Date
    11-10-2017
    Location
    Boston, MA
    MS-Off Ver
    2016
    Posts
    13

    Finding value of date within date range + one other criteria

    Let's say I have a cleaning company. OK I have one data set which has 2 columns, lists people and the date they were serviced:
    CLIENT DATE-OF-SERVICE
    Smith 1/3/2017
    Johnson 3/4/2017
    Jones 10/4/2016
    etc.

    Then I have another data set, 4 columns, that shows invoice #s with the date range each invoice covers
    INVOICE# CLIENT DATESTART DATEEND
    1001 Johnson 3/1/2017 3/31/2017
    1002 Adams 4/1/2016 4/30/2016
    1003 Williams 10/1/2017 10/30/2017
    etc.

    How could I create a formula that would match the last name and find the corresponding invoice# for a given date of service? I saw some formulae that can lookup a value based on a date range but the tricky part is integrating the last name to make sure we get the right client's invoice. Multiple invoices may cover the same date range - we want the one that corresponds to the given last name.

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Finding value of date within date range + one other criteria

    Hello and welcome to the forum.

    With your first data set in columns A:B and your second data set in columns G:J, try this in C2:

    =IFERROR(1/(1/SUMIFS(G:G,H:H,A2,I:I,"<="&B2,J:J,">="&B2)),"No Match")

    Note that this will only work if the INVOICE #'s are actual numbers and there are no duplicates like in your example.

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Finding value of date within date range + one other criteria

    Here's another, more robust formula:

    C2 =IFERROR(INDEX(G$2:G$4,MATCH(1,INDEX((A2=H$2:H$4)*(B2>=I$2:I$4)*(B2<=J$2:J$4),0),0)),"No Match")

  4. #4
    Registered User
    Join Date
    11-10-2017
    Location
    Boston, MA
    MS-Off Ver
    2016
    Posts
    13

    Re: Finding value of date within date range + one other criteria

    OK is it sacrilege to be trying these in Google Sheets? Am I missing something? I can't seem to get it to work in: https://docs.google.com/spreadsheets...it?usp=sharing

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Finding value of date within date range + one other criteria

    You didn't mention that you are using Google Sheets. While Excel and Google Sheets may look similar, they are quite different and it is important to note.

    Also, you posted this in the "Excel Formulas & Functions" area.

    A Google Sheets question should have been posted here: https://www.excelforum.com/for-other...mobile-os-etc/

    Unfortunately, I cannot help with Google Sheets.

  6. #6
    Registered User
    Join Date
    11-10-2017
    Location
    Boston, MA
    MS-Off Ver
    2016
    Posts
    13

    Re: Finding value of date within date range + one other criteria

    My apologies. I thought the formulae were largely the same and worked the same. Will post this over in the other section. May need to move to regular Excel if it doesnt work in GS.

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Finding value of date within date range + one other criteria

    Keep it here and ask a moderator to move it for you. Do not make a duplicate post.

    If you have Excel, write these formulas in Excel then open it in Google Sheets. The formulas will be converted (if required) for you.

+ 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. [SOLVED] finding oldest real date in a date range
    By JakeMann in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-01-2017, 04:50 AM
  2. Replies: 4
    Last Post: 04-28-2017, 11:06 AM
  3. HELP with Finding similar values in same date range -- Multiple Criteria
    By yessuz in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-08-2016, 04:33 AM
  4. Finding Nearest date in a range based on critera date
    By skate1991 in forum Excel General
    Replies: 5
    Last Post: 07-22-2015, 02:10 PM
  5. IF function finding a date in a date range
    By KelleyScott in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-29-2015, 06:26 AM
  6. [SOLVED] find missing date on every group date list based on range and criteria
    By k1dr0ck in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2013, 01:26 AM
  7. Finding a date in a text string and comparing it to a date range
    By ABARAN1000 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-05-2012, 02:55 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