+ Reply to Thread
Results 1 to 3 of 3

calculate the time between two dates excluding weekends

  1. #1
    Forum Contributor
    Join Date
    09-10-2010
    Location
    europe
    MS-Off Ver
    Excel 2007
    Posts
    149

    calculate the time between two dates excluding weekends

    I need to calculate how much time has passed since starting the driver on the way to return back.
    The start date does not matter for 8 hours, ending date also does not matter for 8 hours
    All the days between the start and end date are counted as 8 hours (standard hours)
    Note: to exclude weekend days
    Which formula can be obtained in a single cell during the calculation carried out on the road
    Attached Files Attached Files
    Last edited by Dumy; 07-04-2011 at 05:07 AM.

  2. #2
    Registered User
    Join Date
    05-13-2011
    Location
    New Zealander in London
    MS-Off Ver
    Excel 2007
    Posts
    74

    Re: calculate the time between two dates excluding weekends

    Whew! that took me a bit of messing about, but I got there in the end. Others may have a more clever and graceful way to get the result, I just use brute force.

    I have come up with the following formula for you to place in cell C2 (where A2 has the start date/time combo, and B2 has the finish date/time combo):
    Please Login or Register  to view this content.
    To explain this formula:
    Please Login or Register  to view this content.
    ...calculates the number of full working days (excluding weekends) and multiplies that by 8 hours in a day

    Because the days may not be full days, we need to take the number of hours before the end of the working day (16:00 in this case) off the result of above:
    Please Login or Register  to view this content.
    And then finally take away the number of hours since the start of the day (in this case 08:00) before work commenced.
    Please Login or Register  to view this content.
    In your example of Start: 01/06 11:00 and finish 06:06 14:00 this results in:
    4 working days (4th & 5th are a weekend) multiplied by 8 hours = 32
    ...minus the 2 hours at the end of the day for finishing at 14:00
    ...minus the 3 hours at the start of the day for not starting until 11:00
    ...results in 27 hours

  3. #3
    Forum Contributor
    Join Date
    09-10-2010
    Location
    europe
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: calculate the time between two dates excluding weekends

    Quote Originally Posted by tarquinious View Post
    I just use brute force.
    tarquinious, thank you to the right formula
    Explanation of the formula is fantastic
    I'm just all divided by 24 to get the 27:00:00 time format

+ 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