+ Reply to Thread
Results 1 to 10 of 10

Networkdays formula

  1. #1
    Registered User
    Join Date
    08-05-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Networkdays formula

    Hi, does anyone know the formula for subtracting one date from another date, but only counting business days. I know you can use the NETWORKDAYS formula, but here is a twist - if you subtract 8/26/13 from 08/27/13 the formula would spit out 2. How do you make it so it spits out 1 day?
    Another example, subtract 8/22/13 from 8/26/13 and the answer should be 2 (weekend was subtracted).
    Thank you!

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Networkdays formula

    Try

    =NETWORKDAYS(A1+1,B1)

    A1 = Begin Date, B1 = End Date.

  3. #3
    Registered User
    Join Date
    08-05-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Networkdays formula

    That works, gracias!

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Networkdays formula

    You're welcome.

  5. #5
    Registered User
    Join Date
    08-05-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Networkdays formula

    Actually wait. I found a hole in the formula. If both of the dates are the same, the result is a -2, not 0. ???????

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Networkdays formula

    Yep, this is a core difference between NetworkDays and just plain old B1-A1
    Networkdays INCLUDES both start and end date, while B1-A1 excludes 1 of them.

    Try
    =MAX(0,NETWORKDAYS(A1+1,B1))

  7. #7
    Registered User
    Join Date
    08-05-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Networkdays formula

    Thank you! Let me ask you another question - is there a way to make this formula spit out a negative number. Let's say that the start date comes after the end date...?

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Networkdays formula

    A negative number of days?
    That doesn't really make sense to me (or to Excel)

    I think at best we can reverse the dates so the earliest date is always first...
    Then multiply by 1 or -1 depending on which Date was greatest..

    =MAX(0,NETWORKDAYS(MIN(A1,B1)+1,MAX(A1,B1)))*IF(A1>B1,-1,1)

  9. #9
    Registered User
    Join Date
    08-05-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Networkdays formula

    You are very close, sir. Thank you, but there is one issue, let's say the date in is 8/25/13 and date out is 8/27/13. The count should be 1 day (right now it is 2) as Sunday does not count and it is one day from Monday to Tuesday. Any ideas? Thanks so much for all your help so far.

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Networkdays formula

    I don't know, this is getting a bit too complex for me I think..

    But I have to ask...
    How can an event End Before it Starts?
    If a Start date is on a weekend, I would think Weekends should be included...

+ 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. Networkdays formula
    By Silvie4 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-14-2006, 04:20 PM
  2. [SOLVED] NETWORKDAYS FORMULA
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  3. [SOLVED] NETWORKDAYS FORMULA
    By Lichase in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  4. [SOLVED] NETWORKDAYS FORMULA
    By Lichase in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. [SOLVED] NETWORKDAYS help with the formula
    By Zoeb1979 in forum Excel General
    Replies: 1
    Last Post: 05-09-2005, 11:06 AM

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