Closed Thread
Results 1 to 9 of 9

Calculate only working hours between two dates with several constraints

  1. #1
    Registered User
    Join Date
    08-21-2018
    Location
    NYC, USA
    MS-Off Ver
    Excel 2013
    Posts
    4

    Calculate only working hours between two dates with several constraints

    Hi all,


    I have read many threads regarding the calculation of working hours between two dates, but couldn't file a solution that fits my problem.
    I am facing a difficult calculation as there are many constraints.

    I need to calculate the time elapsed between two tickets raised. A client raises a ticket, at any time and any day, and our staff resolves the ticket within our working hours.
    I then need to calculate the time it takes to resolve the ticket within the working hours, including the weekend, and excluding bank holidays. If a ticket is resolved outside of working hours and days, only the time WITHIN the working hours and days should be counted.

    I have found great answers that either include or exclude weekend. However, I have 3 major constraints that make all the formulas and solutions proposed unusable:


    • I manage several locations, each location has different working hours and different working days. E.g. NYC is open from Monday to Sunday, with different hours for each day. Los Angeles only Monday to Friday. New Orleans Monday to Saturday. Again, the working hours are different each day (e.g. Monday to Friday 5am 730pm, Saturday 6am - 2pm, Sunday 9am - 5pm).
    • Each location has different Bank Holidays because they're located in different states (and sometimes countries).
    • Some of our locations have working hours that go late into the night (e.g. 5am to 1am).


    I have tried the NETWORKDAYS.INTL for each day and summing them but this hasn't work.
    Also, I cannot seem to calculate properly working hours when they extend to the day after (e.g. office open from 5am Tuesday to 1am Wednesday).

    I have attached the file I am using. Tab 1 is for calculation. Tab 2 is the working hours for each location/day, Tab 3 is the list of Bank Holidays.

    I have spent days on this, I cannot wrap my head around this problem.

    Please help me.

    Cheers,
    Jill
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate only working hours between two dates with several constraints

    Hi Jill. Welcome to the forum.

    I'm just bumping your thread to let you know someone is working on it ... and making some progress.
    Dave

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate only working hours between two dates with several constraints

    Jill,

    How do you want to handle LA with Start Date of 2/11/2017 (a Saturday ... in C4 of 'Time Calculation') when the table in 'Working Hours' shows N/A for LA on Saturdays?

    Similar question for Mumbai.

    Also Charlotteville doesn't start until 5:00 AM on Mondays yet there is a start time of Midnight on 3/27/2017. I'm confused.

  4. #4
    Registered User
    Join Date
    08-21-2018
    Location
    NYC, USA
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Calculate only working hours between two dates with several constraints

    Hi FlameRetired,

    Thanks a lot for your answers. It gives me a bit of hope.
    Basically a ticket can be raised at anytime or anyday by a client. So it can be raised outside of working hours. It ALSO can be resolved at anytime by our staff, during "overtime". However, since we have "official business hours", only the time elapsed WITHIN the official working hours (Tab 2) need to be measured.

    So in LA our working hours are only from Monday to Friday, however a client can raise a ticket on Saturday, and our "overtime" staff can resolve it also on Saturday. In this case, the time elapsed would be zero (0), because it is both raised and solved outside of "official business hours."

    Am I expressing myself correctly? I can try to explain it more clearly if necessary.

    Thanks a lot FlameRetired!

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate only working hours between two dates with several constraints

    Thank you for clarifying that.

    Those factors make it even more challenging. Are you open to lots of helper columns/rows?

  6. #6
    Registered User
    Join Date
    08-21-2018
    Location
    NYC, USA
    MS-Off Ver
    Excel 2013
    Posts
    4
    Quote Originally Posted by FlameRetired View Post
    Thank you for clarifying that.

    Those factors make it even more challenging. Are you open to lots of helper columns/rows?

    Yes, without any doubt. I just want to solve this problem. Any help is immensely appreciated.

    Thanks Dave.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate only working hours between two dates with several constraints

    I can get the NETWORKDAYS.INTL scheduled hours for each Report/Resolution pair and account for days off and holidays.

    What I can not find is a reliable/consistent way to subtract hours where start/end are inside (and sometimes outside) those schedule boundaries.

    If you would like I can upload what I have so far. It is a long way from complete. Let me know and I'll clean up a copy of that file.
    Last edited by FlameRetired; 08-23-2018 at 11:06 PM.

  8. #8
    Registered User
    Join Date
    08-21-2018
    Location
    NYC, USA
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Calculate only working hours between two dates with several constraints

    Hey Dave,

    Yes that could be helpful if you uploaded that file.
    Thanks

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Calculate only working hours between two dates with several constraints

    Closed at OP request to open in Commercial Services.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calculate working hours between two dates/times
    By Drscott21 in forum Excel General
    Replies: 2
    Last Post: 04-03-2018, 12:55 PM
  2. To calculate the working hours excluding weekends between two dates
    By Ammuma in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 04-17-2016, 12:14 PM
  3. How to calculate the number of working hours between 2 dates
    By Rupe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-04-2014, 12:02 PM
  4. Replies: 9
    Last Post: 03-08-2013, 11:50 AM
  5. Calculate working hours between two dates
    By nirmala.seetharaman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-19-2012, 06:36 AM
  6. Calculate response time in working hours between two dates
    By ajagibson in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-28-2012, 01:21 PM
  7. calculate the number of working hours between two dates
    By sureshchinna_sb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-29-2012, 09:57 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