+ Reply to Thread
Results 1 to 6 of 6

Business Hours between 2 dates/times excluding weekends and holidays

  1. #1
    Registered User
    Join Date
    08-01-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Business Hours between 2 dates/times excluding weekends and holidays

    We have a system that tracks the beginning and ending date/time of customer inquiry tickets opened. I need to be able to track how many business hours it is taking to close a ticket. Our bus hours are from 8AM to 8PM Monday through Friday, and we are closed on holidays.
    Example
    Cust Ticket opened date/time 2/8/2019 14:00
    Cust Ticket closed date/time 2/12/2019 15:28
    When i manually calculate the time, I get 25:28 [hh]:mm. Unfortunately, we receive over 300 tickets each week so manual calculation is impractical. Is there a formula that would provide the duration, in business hours, that it took for us to close the customer's ticket?

    Any help would be greatly appreciated.

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Business Hours between 2 dates/times excluding weekends and holidays

    See below:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Adapt the above references to reflect your actual layout where:

    A2 = start date time
    B2 = end date time
    Z1:Z20 = holiday date range

    for ref. the above would generate 25:28:00 {when formatted as [hh]:mm:ss) with your sample values in A2 & B2.
    Last edited by XLent; 02-14-2019 at 05:14 AM. Reason: confirmed it would generate expected result, for OP

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Business Hours between 2 dates/times excluding weekends and holidays

    That could be shortened to

    =(NETWORKDAYS($A2,$B2,$Z$1:$Z$20)-1)*("20:00"-"08:00")+MOD($B2,1)-MOD($A2,1)

    without compromising functionality.

    The addtitional networdays functions in post #2 will never result in anything other than 1, so are not needed.
    The median functions would only be required if there is a need to adjust any times that are outside of normal business hours up or down to the closest start or end of day.

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Business Hours between 2 dates/times excluding weekends and holidays

    Yes, I perhaps should have been clearer, the suggested approach in post 2 is designed, specifically, to address possibility of either start/end datetime falling outside the working day.

    Whilst the above is not called out as a specific requirement, and admittedly unlikely for an end date, it is the more robust approach IMO.

    should add, completely plagiarised from the great @daddylonglegs
    Last edited by XLent; 02-14-2019 at 08:52 AM. Reason: reworded narrative to better clarify

  5. #5
    Registered User
    Join Date
    08-01-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Business Hours between 2 dates/times excluding weekends and holidays

    This is perfect - thank you! And yes, we receive tickets 24 hrs a day and so start/end datetime is often outside of the working day. The only adjustment I made was to begin with the condition that if starttime>endtime, "" - weird but happens every now and then.

    Much appreciation for your help!!

    How do I mark this as solved and send kudos?

  6. #6
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Business Hours between 2 dates/times excluding weekends and holidays

    Glad the solutions provided work for you.

    Regards closing -- please see below (taken from FAQ):

    To mark your thread solved do the following:

    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

+ 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] How To Calculate Net Work Hours Between Two Dates Excluding Weekends Or Holidays?
    By pavankumarbangaru in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-23-2018, 11:52 AM
  2. Replies: 13
    Last Post: 07-20-2016, 02:05 AM
  3. Replies: 9
    Last Post: 07-04-2016, 11:42 PM
  4. Replies: 4
    Last Post: 07-27-2015, 08:45 PM
  5. [SOLVED] Calculating handling times between two dates, in hours, excluding holidays/weekends
    By Tunesmith in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-17-2015, 01:44 PM
  6. Replies: 0
    Last Post: 01-30-2014, 01:22 AM
  7. [SOLVED] Calulating Time Between Two Dates/Times but Excluding Weekends and Holidays
    By randers1984 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-15-2013, 10:24 AM

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