+ Reply to Thread
Results 1 to 10 of 10

Formula to calculate SLA by excluding non-business hours, weekends and holidays

  1. #1
    Registered User
    Join Date
    06-20-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    5

    Formula to calculate SLA by excluding non-business hours, weekends and holidays

    Hi Everyone,

    I have a data of Incidents with Start date with time, End time with time.

    Start time: 7/1/13 10:30 AM in C2 cell

    End time: 7/9/13 5:33 PM in D2 cell

    Formula which i was using to calculate SLA was =(NETWORKDAYS(C2,D2)-1)*("18:00"-"08:00")+IF(NETWORKDAYS(C2,D2),MEDIAN(MOD(D2,1),"18:00","08:00"),"18:00")-MEDIAN(NETWORKDAYS(C2,C2)*MOD(C2,1),"18:00","08:00")

    The TTR is 67:03:07

    Now the above formula excludes just the week ends and non-business hours.

    But i need to exclude the bank holidays as well.

    Business hours are 08:00:00 to 18:00:00.

    Kindly help me towards Resolution.

    Regards
    Kokila.S

  2. #2
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Formula to calculate SLA by excluding non-business hours, weekends and holidays

    Hi
    Have a look at this link which gives you a solution:
    http://www.mrexcel.com/forum/excel-q...-weekends.html
    Good luck.
    Tony

  3. #3
    Registered User
    Join Date
    06-20-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Formula to calculate SLA by excluding non-business hours, weekends and holidays

    Hi Tony,

    Thank you very much for your help. will check and update the status shorlty.

    Regards
    Kokila.S

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

    Re: Formula to calculate SLA by excluding non-business hours, weekends and holidays

    There's an error in your current formula, the second NETWORKDAYS function should be NETWORKDAYS(D2,D2).

    You can use that corrected formula but add a holiday range to each of the networkdays functions, e.g. if you list holiday dates in H2:H10 try

    =(NETWORKDAYS(C2,D2,H$2:H$10)-1)*("18:00"-"08:00")+IF(NETWORKDAYS(D2,D2,H$2:H$10),MEDIAN(MOD(D2,1),"18:00","08:00"),"18:00")-MEDIAN(NETWORKDAYS(C2,C2,H$2:H$10)*MOD(C2,1),"18:00","08:00")
    Audere est facere

  5. #5
    Registered User
    Join Date
    06-20-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Formula to calculate SLA by excluding non-business hours, weekends and holidays

    Hi Audere,

    Thank you very much for your help. you have made my day.

    its working completely fine.

    Regards
    Kokila.S

  6. #6
    Registered User
    Join Date
    11-17-2015
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Formula to calculate SLA by excluding non-business hours, weekends and holidays

    Hi daddylonglegs

    This formula works perfectly, but can you please help me to understand what is it doing?
    I have to explain this to someone but to be honest, I have no idea what it is doing.

    Please help, thanks!

  7. #7
    Registered User
    Join Date
    02-15-2016
    Location
    Banbury
    MS-Off Ver
    2010
    Posts
    2

    Re: Formula to calculate SLA by excluding non-business hours, weekends and holidays

    Hi Kokila,

    Please can you share me the Sample spreadsheet.

    Regards, Sama

  8. #8
    Registered User
    Join Date
    05-02-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Formula to calculate SLA by excluding non-business hours, weekends and holidays

    Hi Guys,

    I tried the above formula of "=(NETWORKDAYS(C2,D2,H$2:H$10)-1)*("18:00"-"08:00")+IF(NETWORKDAYS(D2,D2,H$2:H$10),MEDIAN(MOD(D2,1),"18:00","08:00"),"18:00")-MEDIAN(NETWORKDAYS(C2,C2,H$2:H$10)*MOD(C2,1),"18:00","08:00")"

    But it gives me 01/01/1900 21:00...how do i get the total time in hh:mm:ss.....

    If i convert the above result it only gives me 21:00:00.


    Thanks,
    Vicky

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Formula to calculate SLA by excluding non-business hours, weekends and holidays

    Format Cells -> Custom -> [h]:mm

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Formula to calculate SLA by excluding non-business hours, weekends and holidays

    vickychune welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Replies: 2
    Last Post: 06-14-2013, 10:45 AM
  2. Calculate Business Hours exluding weekends and holidays with a caveat
    By teamdob in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-22-2012, 11:55 AM
  3. Replies: 4
    Last Post: 08-10-2012, 11:41 AM
  4. Replies: 7
    Last Post: 01-11-2011, 06:26 AM
  5. Calculate number of business days excluding weekends and holidays?
    By sethi85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-07-2007, 02:11 PM

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