+ Reply to Thread
Results 1 to 3 of 3

Networkdays

  1. #1
    Registered User
    Join Date
    05-01-2008
    Posts
    46

    Networkdays

    =(NETWORKDAYS(A2,B2)-1)*(EndTime-StartTime+StartLun-EndLun)+MOD(B2,1)-MOD(A2,1)+((MOD(B2,1)<StartLun)-(MOD(A2,1)<StartLun))*(EndLun-StartLun)

    The above formula assumes that A2 and B2 will always be within the working hours, as the start time and end time are between 9-5 (Normal working hours), how would i get this formula to tell me

    1. add the time on start or finish if task start time is before 9 or after 5, or if the finish time is before 9 or after 5
    2. Add the time if the task starts on a weekend and finishes on a weekend

    Many thanks if you can help me out
    PS StartLun and EndLun is between 12-1PM

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    This formula will only count business hours [those hours between StartTime & StartLun and EndLun & EndTime Monday to Friday] even if A2 or B2 is at the weekend, in the evening (or early morning) or within lunch break

    =(NETWORKDAYS(A2,B2)-1)*(EndTime-StartTime+StartLun-EndLun)+IF(NETWORKDAYS(B2,B2),MEDIAN(MOD(B2,1), EndTime,StartTime)-MEDIAN(MOD(B2,1), EndLun,StartLun),EndTime-EndLun)-IF(NETWORKDAYS(A2,A2),MEDIAN(MOD(A2,1), EndTime,StartTime)-MEDIAN(MOD(A2,1), EndLun,StartLun),StartTime-StartLun)
    Last edited by daddylonglegs; 05-16-2008 at 10:21 AM.

  3. #3
    Registered User
    Join Date
    05-01-2008
    Posts
    46
    thanks ever so!

+ 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