Results 1 to 3 of 3
  1. #1
    typebr2024 is offline Novice
    Windows 11 Office 365
    Join Date
    Mar 2024
    Posts
    1

    Complex Calculation business hours

    Dear expert,
    I would greatly appreciate it if someone else could assist me with this complex calculation.

    I am attempting to calculate the 8 business hours from the creation date and hour of record, taking into account the exclusion of time for the weekends, holidays, and within business hours


    Example1


    Start Date & Time: 01/03/2024 08:00:00 AM
    Desired Due Date: 01/03/2024 16:00:00 PM

    Example2
    Start Date & Time: 01/03/2024 11:00:00 AM
    Weekends: Saturday and Sunday
    Holiday = 04/03/2024
    Desired Due Date: 05/03/2024 09:00:00 AM

    Working hours: 08:00 AM to 18:00 PM
    Holidays: (I have a list of holidays) for the test we can consider 04/03/2024
    Business Days: Monday to Friday
    Weekends: Saturday and Sunday

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Have a look at the similar threads at the bottom of the page.
    This is a very frequently asked question.

    There is a sample db here https://www.access-programmers.co.uk...tabase.298179/

    Most of them deal with working days, but the process will be very similar.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,474
    Can do in Code I'm sure. Would need a table of Holiday dates. VBA code starts on first day, is it a Sat, Sun or Holiday, skip it, move to next day, if not count the hours, Move to next day, etc till you hit the end date. You will need to account for if say the first day starts at noon so you only add 12 hours and not 24, etc. For example 2, would the 1/3 date only allow 6 hours if the work day ends at 5pm since you started at 11am? Do you have to account for lunch break, etc.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Calculate Business Hours over X amount of business days.
    By gutarkomp in forum Code Repository
    Replies: 5
    Last Post: 05-16-2017, 06:23 PM
  2. hours calculation
    By faisal88 in forum Forms
    Replies: 5
    Last Post: 01-29-2017, 03:02 AM
  3. Number of Calls during business hours
    By desireemm1 in forum Queries
    Replies: 20
    Last Post: 10-29-2014, 06:24 PM
  4. Replies: 4
    Last Post: 01-17-2014, 10:53 PM
  5. calculation hours Question...
    By ultra5219 in forum Access
    Replies: 3
    Last Post: 04-22-2013, 10:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums