+ Reply to Thread
Results 1 to 9 of 9

Looking for a date between variable intervals

  1. #1
    Registered User
    Join Date
    10-06-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    16

    Looking for a date between variable intervals

    Hello, people! I am in a real pickle with this excel sheet. I have a list of deliveries, with dates. I also have a list of drivers, with different roles that may change with time. I need to find a way to return the rate of the delivery based on the delivery date, the driver, and his/her role at the time of the delivery.

    Basically, the thinking should be this: I have a delivery, who is the driver, look for the role does that driver has on the day of the delivery, then return the correct rate. The delivery list is not fixed, so deliveries can be added. The roles of the drivers can change in time.

    I've attached an excel example, with some comments in red.

    Does anyone have any idea how to achieve this?

    Thank you very much!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,732

    Re: Really tricky: looking for a date between variable intervals (I think this sums is up)

    Try

    in E12

    =INDEX($B$6:$C$6,MATCH(INDEX($A$2:$Z$100,MATCH($D12,$A$2:$A$100,0),MATCH($A12,INDEX($B$2:$Z$100,MATCH($D12,$A$2:$A$100,0),0),1)),$B$5:$C$5,0))

    copy down
    Attached Files Attached Files

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Really tricky: looking for a date between variable intervals (I think this sums is up)

    Is there any flexibility in the layout? Can I change the layout of rows 1-3 of DRIVER?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Really tricky: looking for a date between variable intervals (I think this sums is up)

    Never mind... not needed.

  5. #5
    Registered User
    Join Date
    10-06-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    16

    Re: Really tricky: looking for a date between variable intervals (I think this sums is up)

    John, you're a genius! I think it works! I'll play around with it a bit and come back with a reply.

    Glenn, yes, the layout of the first rows is flexible. Actually, I welcome the suggestion.

    Thank you both!

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Really tricky: looking for a date between variable intervals (I think this sums is up)

    Hi all- Probably like John's, but:
    Please Login or Register  to view this content.
    Named ranges: Name = Driver!$A$2:$A$3, Data = Driver!$B$2:$P$3

    BTW- Your suggested result on row 20 was incorrect. It said 200, should be 100.
    Attached Files Attached Files
    Last edited by leelnich; 10-17-2017 at 08:23 AM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  7. #7
    Registered User
    Join Date
    10-06-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    16

    Re: Really tricky: looking for a date between variable intervals (I think this sums is up)

    It's a very good approach, leelnich. Mixing John's solution with your idea, I came up with a dynamic named range approach. I'm just going to post it in case any other noob like myself needs it:

    =INDEX($B$8:$C$8,MATCH(INDEX(rolesanddates,MATCH($D14,drivers,0),MATCH($A14,INDEX(rolesanddates,MATCH($D14,drivers,0),))-1),$B$7:$C$7,0))

    where $B$8;$C$8 are the return value, $B$7:$C$7 the lookup values, and the named ranges are as follows:

    drivers "=OFFSET(Driver!$A$2,0,0,COUNTA(Driver!$A:$A)-21,1)"
    rolesanddates = "=OFFSET(Driver!$B$2,0,0,COUNTA(Driver!$B:$B)-22,COUNTA(Driver!$2:$2)-1)"

    Adjust the minuses to fit.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,381

    Re: Looking for a date between variable intervals

    Thanks for posting this!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  9. #9
    Registered User
    Join Date
    10-06-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    16

    Re: Looking for a date between variable intervals

    Thank all of you guys for the quick replies. You're great!

+ 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. Replies: 1
    Last Post: 09-27-2016, 12:41 AM
  2. Copy cell values in other column with variable intervals
    By ce169 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-20-2016, 04:28 PM
  3. Calculate Rolling Sum for Last 12 Months - Variable Entry Intervals
    By jancer in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-10-2012, 03:51 PM
  4. Incremental numbering at variable intervals of rows
    By tek9step in forum Excel General
    Replies: 4
    Last Post: 03-18-2011, 09:58 AM
  5. Insert total at variable intervals
    By Spellbound in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-27-2009, 10:02 PM
  6. Setting x axis scale to time with variable intervals
    By webbuzzard in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-27-2005, 03:05 PM

Tags for this Thread

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