+ Reply to Thread
Results 1 to 12 of 12

Calculating the SLA end date and time

  1. #1
    Registered User
    Join Date
    04-17-2013
    Location
    Hilversum, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    5

    Calculating the SLA end date and time

    Hello,

    I'm new to this forum and hope somebody can help me. I want to calculate the SLA end date from a given start date. The SLA time is 30 hours and is only measured during working days.

    If a job comes in over the 'weekend' the clock does not start ticking until 07:30 am Monday morning. If a job comes over during working days in the evening after 16:30 pm, the clock does not start ticking until 07.30 am next morning.

    So monday 12.30 + 30 hrs = tuesday 18:30
    Friday 14:30 + 30 hrs = tuesday 11:30

    I have the following formula for a 4 hour SLA time but it didn't worked out for me to convert it to a 30hr SLA. Can you please help me out?

    =WORKDAY(A2-13.5/24,1)+IF(NETWORKDAYS(A2,A2), IF(MOD(A2,1)*24<=13.5,MAX(MOD(A2,1)*24+4,12.5), MIN(MOD(A2,1)*24-5,12.5)),12.5)/24

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating the SLA end date and time

    Quote Originally Posted by leongti View Post
    So monday 12.30 + 30 hrs = tuesday 18:30
    Friday 14:30 + 30 hrs = tuesday 11:30
    Are those two examples correct? In the first example you would be counting all hours (right through the night) from 12:30 Monday to 18:30 Tuesday - it seems odd to me that you don't want to start counting until next workday but then you would count all hours from then.

    In the second example you are presumably not counting from 16:30 on Friday to 07:30 on Monday but you are counting all night on Monday?

    Going by that then

    monday 15.30 + 30 hrs = tuesday 21:30

    but

    monday 17.30 + 30 hrs = wednesday 11:30 (because you don't start counting until tuesday at 07:30)
    Audere est facere

  3. #3
    Registered User
    Join Date
    04-17-2013
    Location
    Hilversum, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Calculating the SLA end date and time

    Yes, that's (almost) totally correct!

    monday 17.30 + 30 hrs = wednesday 11:30 (because you don't start counting until tuesday at 07:30) - Counting from 07:30 on tuesday plus 30 hrs gives wednesday 13:30!

    It may seem odd, but the company we work with only starts a ticket during working days from 07:30 till 16:30. From that moment they have 30 hrs to repair it with the note that weekends and holiday's are excluded.

    So they work from monday 07:30 till friday 16:30 (including the nights, excluding holidays), but they will only start tickets during working days from 07:30 till 16:30. From then on the clock starts ticking for 30 hrs (weekends and holidays excluded from friday 16:30 till monday morning 07:30)

    Thanks for your effort!

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating the SLA end date and time

    I would do this as a two step process with this formula in B2 to get the time that the clock starts ticking

    =IF(OR(NETWORKDAYS(A2,A2)=0,MOD(A2,1)>F$3),WORKDAY(A2,1)+F$2,MAX(A2,INT(A2)+F$2))

    where F2 is day start (07:30 in your case) and F3 is day end (16:30)

    Then in C2 to calculate the SLA end time

    =IF(MOD(B2,1)+WEEKDAY(B2,3)>4+F$3-F$4,3-F$3+F$2)+B2+F$4

    where F4 is the number of hours as a time value, i.e. 30:00 in your case

    Note that this will work for variable values in F2, F3 and F4 as long as F3 > F2 and F4 can't span over more than one weekend, so no longer than approx 105:00 depending on F2 and F3 values.

    The above only excludes weekends, you can add a holiday range into the NETWORKDAYS and WORKDAY functions in the B2 formula and the holidays will be taken into account when determining the "clock ticking" time/date.....but holidays won't be taken into account in C2. If you need to do that then that will be tricky, when you have holidays I assume the clock stops ticking e.g. for a Wed holiday from Tuesday at 16:30 and then restarts at 07:30 on Thursday?
    Last edited by daddylonglegs; 04-29-2013 at 07:44 AM.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,690

    Re: Calculating the SLA end date and time

    You can try ,

    Start time is C3 in Date and time format
    Duration D3 in number format.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-17-2013
    Location
    Hilversum, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Calculating the SLA end date and time

    Quote Originally Posted by daddylonglegs View Post
    I would do this as a two step process with this formula in B2 to get the time that the clock starts ticking

    =IF(OR(NETWORKDAYS(A2,A2)=0,MOD(A2,1)>F$3),WORKDAY(A2,1)+F$2,MAX(A2,INT(A2)+F$2))

    where F2 is day start (07:30 in your case) and F3 is day end (16:30)

    Then in C2 to calculate the SLA end time

    =IF(MOD(B2,1)+WEEKDAY(B2,3)>4+F$3-F$4,3-F$3+F$2)+B2+F$4

    where F4 is the number of hours as a time value, i.e. 30:00 in your case

    Note that this will work for variable values in F2, F3 and F4 as long as F3 > F2 and F4 can't span over more than one weekend, so no longer than approx 105:00 depending on F2 and F3 values.

    The above only excludes weekends, you can add a holiday range into the NETWORKDAYS and WORKDAY functions in the B2 formula and the holidays will be taken into account when determining the "clock ticking" time/date.....but holidays won't be taken into account in C2. If you need to do that then that will be tricky, when you have holidays I assume the clock stops ticking e.g. for a Wed holiday from Tuesday at 16:30 and then restarts at 07:30 on Thursday?
    Hi daddylonglegs, you are amazing! Your formula almost works! For most values it calculates the right time. However, I have some values popping out which cannot be calculated. The faults all have in common that the start date is during working days past 16:30. For instance;

    Tuesday 26 february 2013 22:30
    Wednesday 27 february 2013 16:50

    Can this be solved?

    Great efforts so far!

    @ kvsrinivasamurthy; thanks for your effort, tried the formula but unfortunately didn't work...

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating the SLA end date and time

    Quote Originally Posted by leongti View Post
    Tuesday 26 february 2013 22:30
    Wednesday 27 february 2013 16:50
    What results do you expect for these two start times/dates. For the first one the first formula should give you the "clock ticking" time/date 27 Feb 2013 07:30 and you just add 30 hours to that so the second formula gives you 28 Feb 2013 13:30 - isn't that the required result - the second example works in the same way and should give you 1 Mar 2013 13:30

  8. #8
    Registered User
    Join Date
    04-17-2013
    Location
    Hilversum, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Calculating the SLA end date and time

    See post below, I made a mistake in the translation...
    Attached Images Attached Images
    Last edited by leongti; 05-03-2013 at 04:33 AM.

  9. #9
    Registered User
    Join Date
    04-17-2013
    Location
    Hilversum, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Calculating the SLA end date and time

    I'm sorry, I used the macro function to translate back from Dutch to English and found out that instead of "Werkdag" I used "Werkdagen". The function is working like a charm now! Thanks!

    "but holidays won't be taken into account in C2. If you need to do that then that will be tricky, when you have holidays I assume the clock stops ticking e.g. for a Wed holiday from Tuesday at 16:30 and then restarts at 07:30 on Thursday?"

    This indeed is the only part which is not taken into account yet. There is a free day on january the first but it is seen as a working day...
    Last edited by leongti; 05-03-2013 at 04:08 AM.

  10. #10
    Registered User
    Join Date
    04-29-2021
    Location
    Australia
    MS-Off Ver
    MS 365
    Posts
    2

    Re: Calculating the SLA end date and time

    Quote Originally Posted by leongti View Post
    Hello,

    I'm new to this forum and hope somebody can help me. I want to calculate the SLA end date from a given start date. The SLA time is 30 hours and is only measured during working days.

    If a job comes in over the 'weekend' the clock does not start ticking until 07:30 am Monday morning. If a job comes over during working days in the evening after 16:30 pm, the clock does not start ticking until 07.30 am next morning.

    So monday 12.30 + 30 hrs = tuesday 18:30
    Friday 14:30 + 30 hrs = tuesday 11:30

    I have the following formula for a 4 hour SLA time but it didn't worked out for me to convert it to a 30hr SLA. Can you please help me out?

    =WORKDAY(A2-13.5/24,1)+IF(NETWORKDAYS(A2,A2), IF(MOD(A2,1)*24<=13.5,MAX(MOD(A2,1)*24+4,12.5), MIN(MOD(A2,1)*24-5,12.5)),12.5)/24


    Can someone please explain this formula? where are we defining start time and end time of business hours in this formula?

  11. #11
    Registered User
    Join Date
    04-29-2021
    Location
    Australia
    MS-Off Ver
    MS 365
    Posts
    2

    Re: Calculating the SLA end date and time

    am looking for a formula to calculate sla end time. SLA duration is 12 hours . Business hours : 10.00 - 18.00. need to exclude non business hours and weekends
    Last edited by venni; 04-30-2021 at 12:09 AM.

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,814

    Re: Calculating the SLA end date and time

    Administrative Note:

    Hello venni and Welcome to Excel Forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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