+ Reply to Thread
Results 1 to 5 of 5

Date/Time Calculation excluding weekends and holiday list not working

  1. #1
    Registered User
    Join Date
    07-30-2012
    Location
    Edina, MN
    MS-Off Ver
    Excel 2007
    Posts
    3

    Date/Time Calculation excluding weekends and holiday list not working

    I have a shared workbook that tracks different task metrics. On each sheet, some data elements that are captured is a copy/paste from the date/timestamp from lotus notes email as a begin time and then a macro is set up to populate the end time with the current time. The begin time (7/25/2012 10:11:00 AM) and end time (7/26/2012 8:58:38 AM) are in date with 12 hour format. I have a holiday schedule set up on the "Dropdowns" tab that lists the holidays for the current year in a table. I cannot seem to get Excel to caclulate the proper elapsed time between the begin time and the end time excluding weekend (Saturdays and Sundays) and holiday (my created list) times. I'm trying to output the elapsed time in general format that would give me a TAT that I can round to either tenths or hundreths of a day (i.e. 1.50 days = 36 hours)

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

    Re: Date/Time Calculation excluding weekends and holiday list not working

    Will the start and end times always be on working days? If so then with start time/date in A2 and end time/date in B2 try this formula for the number of elapsed days (excluding weekends and holidays) as a decimal

    =NETWORKDAYS(A2,B2)-1+MOD(B2,1)-MOD(A2,1)
    Audere est facere

  3. #3
    Registered User
    Join Date
    07-30-2012
    Location
    Edina, MN
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Date/Time Calculation excluding weekends and holiday list not working

    Thanks for the heads up. The begin and end times won't necessarily be on a "working" day. What risk does the above run in that case?

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

    Re: Date/Time Calculation excluding weekends and holiday list not working

    In that case you can use this formula, assuming you have holiday dates listed in H2:H10

    =NETWORKDAYS(A2,B2,H$2:H$10)+NETWORKDAYS(B2,B2,H$2:H$10)*(MOD(B2,1)-1)-NETWORKDAYS(A2,A2,H$2:H$10)*MOD(A2,1)

    That will count all hours (midnight to midnight) on working days

  5. #5
    Registered User
    Join Date
    07-30-2012
    Location
    Edina, MN
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Date/Time Calculation excluding weekends and holiday list not working

    Thank you so much, this works great!

+ 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