+ Reply to Thread
Results 1 to 6 of 6

Networkdays formula

  1. #1
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Networkdays formula

    I have an issue where I need to workout the number of days between a set of dates. Now using just the Networkdays formula isnt any good as I need to determine if both the dates are falling into the correct week I want to report on. I have used this formulas below, but they are cumbersome and prone to crashing excel, is there an easier way that I can do this in one formula and not 3?

    I need to use Monday as Day1 of the week

    StartDate - 09/09/2010 11:18:51 (cell C2)
    EndDate - 06/09/2010 10:49:02 (cell L2)

    RevisedStartDate - IF(WEEKDAY(C2,2)=7,C2+1,IF(WEEKDAY(C2,2)=6,C2+2,C2))
    RevisedEndDate - IF(WEEKDAY(L2,2)=7,L2-2,IF(WEEKDAY(L2,2)=6,L2-1,L2))

    DaysDifference
    IF(NETWORKDAYS(O2,N2,PublicHolidays!B5:B28)>=0,(NETWORKDAYS(O2,N2,PublicHolidays!B5:B28)-1),(NETWORKDAYS(O2,N2,PublicHolidays!B5:B28))+1)

    Another issue I have is that if I call a range for the PublicHolidays it returns #N/A.

    How can I do this?
    Last edited by JezLisle; 11-04-2010 at 05:59 AM.

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

    Re: Networkdays formula

    I assume the revised start date is O2 (or is it N2)? For O2 try

    =NETWORKDAYS(WORKDAY(C2-1,1,holidays),WORKDAY(L2+1,-1,holidays),holidays)-SIGN(NETWORKDAYS(WORKDAY(C2-1,1,holidays),WORKDAY(L2+1,-1,holidays),holidays))

    where holidays is a named range containing the holiday dates
    Audere est facere

  3. #3
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Re: Networkdays formula

    Quote Originally Posted by daddylonglegs View Post
    I assume the revised start date is O2 (or is it N2)? For O2 try

    =NETWORKDAYS(WORKDAY(C2-1,1,holidays),WORKDAY(L2+1,-1,holidays),holidays)-SIGN(NETWORKDAYS(WORKDAY(C2-1,1,holidays),WORKDAY(L2+1,-1,holidays),holidays))

    where holidays is a named range containing the holiday dates
    Yes O2 was the Revised StartDate & N2 is the Revised EndDate

  4. #4
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Re: Networkdays formula

    Excellent thanks for this its worked a treat!! :-)

  5. #5
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Re: Networkdays formula

    I have been using the formula for a couple days now. I thought it was doing what I was looking at, but have an issue with it. In the attached example I have put my old way with the new formula and in this you can see a difference between the dates... The formula is often showing there is no difference between the dates when there is

    RefID OrderTaken DelDate Revised Start Revised End Network Days NewCalc
    74388 20/10/2010 20/10/2010 20/10/2010 20/10/2010 0 0
    71508 06/10/2010 07/10/2010 06/10/2010 07/10/2010 1 0

    How can I rectify this?
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    06-06-2008
    Location
    Manchester
    MS-Off Ver
    MS Office 2003
    Posts
    161

    Re: Networkdays formula

    Please ignore the last thread, it was me being a dope and realised i had put the columns wrong on the formula

    Issue has now been solved

+ 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