+ Reply to Thread
Results 1 to 9 of 9

Counting working days excluding holiday and weekends

  1. #1
    Registered User
    Join Date
    11-26-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    11

    Counting working days excluding holiday and weekends

    What I need is a formula to include date and time for determining how long work items are being completed in.

    Here is some sample data:
    Start Date and Time End Date and Time
    Work Create Datetime Work Completed Datetime Work Elapsed Time (in Sec)
    4/28/14 9:31 5/1/14 11:39 363
    4/28/14 9:31 5/1/14 11:48 160
    4/28/14 9:33 5/1/14 11:57 93
    4/28/14 9:34 4/28/14 13:23 50
    4/28/14 9:36 5/1/14 12:26 359
    4/28/14 9:37 5/1/14 9:26 65
    4/28/14 9:45 4/28/14 11:47 128

    I need to have the duration for amount of days to complete the task.

    Any help is greatly appreciated.
    Last edited by thollander; 06-20-2014 at 11:26 AM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Counting working days excluding holiday and weekends

    you can use networkdays()
    NETWORKDAYS
    Returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays. Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days worked during a specific term.
    NETWORKDAYS(start_date,end_date,holidays)
    http://office.microsoft.com/en-gb/ex...005209190.aspx
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Counting working days excluding holiday and weekends

    Look up the syntax for NETWORKDAYS. It does exactly what you want. In essence it's =networkdays(start date, end date, range of cells containing holidays). You'll probably need to reformat the date/times to show only dates. If you're stuck, upload a spread sheet containing some examples and a list of holidays...
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    11-26-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Counting working days excluding holiday and weekends

    the Networkdays returns the value as a whole number I need to break it down so that it is not a whole number but a decimal. so that if the work item only took 28 hours to complete that it would show 1.167 days to complete. I have attached a spreadsheet to see. I know the simple formula would be as follows =sum(B1-A1) that formula will work if there are no weekends. Because they want the work day calculation and not calendar I need to be able to take out the weekends.

    In the attached
    Column D equals total time to complete the transaction.
    Column E =Networkdays
    Example.xlsx

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Counting working days excluding holiday and weekends

    try
    =NETWORKDAYS(A2,B2)+((B2-A2)-INT(B2-A2))

    from this post, added by cbatrody
    http://www.excelforum.com/excel-form...-weekends.html

  6. #6
    Registered User
    Join Date
    11-26-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Counting working days excluding holiday and weekends

    I gave that a try and what I was noticing in the data is that it either gave me the same result as =SUM(B2-A2) or it increased the result by one whole day. See the attached. The items in green in column E do not have weekends and so those are okay, though the formula that I tried increased the total time by a whole day. The items in red for Column E were completed after the weekend and so those it does not look like saturday and Sunday are being taken out of the formula. There are some instances in which the transaction was completed on Saturday so it would just need to substract one day.

    Example.xlsx

  7. #7
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Counting working days excluding holiday and weekends

    does this work better
    =NETWORKDAYS(A81,B81,Holidays!A1:A7)-1-MOD(A81,1)+MOD(B81,1)
    was not sure about the hours part
    http://www.exceltip.com/excel-date-t...two-dates.html
    http://chandoo.org/wp/2010/09/10/working-hours-formula/
    Last edited by etaf; 06-20-2014 at 11:23 AM.

  8. #8
    Registered User
    Join Date
    11-26-2013
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Counting working days excluding holiday and weekends

    Awesome that worked out exactly how it needed to be.

  9. #9
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Counting working days excluding holiday and weekends

    excellent - thanks for the rep

+ 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: 4
    Last Post: 05-19-2014, 04:28 PM
  2. Replies: 7
    Last Post: 06-19-2013, 05:45 AM
  3. Date/Time Calculation excluding weekends and holiday list not working
    By mikeyk80 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-31-2012, 10:39 AM
  4. Difference in Days Excluding Saturday and Public Holiday
    By Kumara_faith in forum Excel General
    Replies: 19
    Last Post: 10-06-2010, 08:50 PM
  5. Replies: 3
    Last Post: 03-31-2008, 01:27 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