+ Reply to Thread
Results 1 to 9 of 9

Networkdays formula producing negative result

  1. #1
    Registered User
    Join Date
    04-27-2015
    Location
    Stockton, NJ
    MS-Off Ver
    2013
    Posts
    12

    Networkdays formula producing negative result

    Hello,

    I'm getting a result of -30089; with the below formula. There is no date in R43 and S43 yet. F3 is today's date using Excel's =TODAY() function.


    =IF(N43="","",IF(N43>R43,NETWORKDAYS(N43,R43),IF(N43>S43,NETWORKDAYS(N43,R43),NETWORKDAYS(N43,$F$3))))

    Any suggestions?

    Thank you.

  2. #2
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: Networkdays formula producing negative result

    Hello Jeni,

    What are you trying to expect the desired result to be??

    Also, I tried the same function at my end, and I don't see any result is returing to -30089 as I left the R43 & S43 as blank too.

    Btw may i ask what is in N43???


    Cheers!!!

    Anil Dhawan
    Thanks,
    Anil Dhawan


    Click *Add Reputation to say "Thanks" and don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved) if you are satisfied.

    Don't stop when you are tired. STOP when you are done!

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Networkdays formula producing negative result

    The error is because there is no date in R43. What result are expecting if one of the dates isn't set? You may want to change your test to

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    By the way, I believe your formula can be factored down to the following, if you are inclined to factoring:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: Networkdays formula producing negative result

    Assuming you have "30-Apr-15" in N43.

    And If you see your formula, It is testing first that whether N43 is blank or not? If it is blank then your result will return will be empty else it is jumping into Nested IF condition.

    Now, If you see and check the first nested if, then you would see that N43 is greater then R43, then it's calculating Networkdays where the starting date is N43 (which is 30-Apr-15) & End Date is R43 which is blank so the result will be returing to -30089.

    Hope my explanation will make your picture clear.


    Cheers!!!

    Anil Dhawan

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Networkdays formula producing negative result

    =IF(N43="","",IF(AND(N43>R43,R43<>""),NETWORKDAYS(N43,R43),IF(AND(N43>S43,S43<>""),NETWORKDAYS(N43,s43),NETWORKDAYS(N43,$F$3))))
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Registered User
    Join Date
    04-27-2015
    Location
    Stockton, NJ
    MS-Off Ver
    2013
    Posts
    12

    Re: Networkdays formula producing negative result

    Thank you!

    First N43 is the date I need to check against the date in Column "R" or Column "S" or "F3" todays date.

    Yes, I do want a blank if N43 is blank.

    I made an error on the formula it should be =IF(N43="","",IF(N43>R43,NETWORKDAYS(N43,R43),IF(N43>S43,NETWORKDAYS(N43,S43),NETWORKDAYS(N43,$F$3))))

    I did try the formula "Factored down" and result is "0".

    The result I want is the number of weekdays from either "R" or "S" or "F3". Whichever has a date. F3 only if there is no date in "R" or "S".

    Thank you.

  7. #7
    Registered User
    Join Date
    04-27-2015
    Location
    Stockton, NJ
    MS-Off Ver
    2013
    Posts
    12

    Re: Networkdays formula producing negative result

    Hello.

    I stand corrected.

    =IF(N43="","",IF(AND(N43>R43,R43<>""),NETWORKDAYS(N43,R43),IF(AND(N43>S43,S43<>""),NETWORKDAYS(N43,s43),NETWORKDAYS(N43,$F$3)))) WORKS!

    Many Thanks.

  8. #8
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: Networkdays formula producing negative result

    Have your purpose solved???

    If yes, then can you please mark this thread as SOLVED and say thanks those who helped you by adding * Add Reputation.

    and If not, then please ignore this message.
    Last edited by adhawan06; 05-01-2015 at 05:31 PM.

  9. #9
    Registered User
    Join Date
    04-27-2015
    Location
    Stockton, NJ
    MS-Off Ver
    2013
    Posts
    12

    Re: Networkdays formula producing negative result

    And I'm back...

    =IF(N43="","",IF(AND(N43>R43,R43<>""),NETWORKDAYS(N43,R43),IF(AND(N43>S43,S43<>""),NETWORKDAYS(N43,s43),NETWORKDAYS(N43,$F$3))))

    I'm getting crazy results.


    F3=Today's date.

    Result N R S

    33 3/18/15 3/18/15 3/18/15 3/23/15 3/23/15

    Result I think should be 3.

    Thank you.

+ 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. [SOLVED] IF formula using dates not producing correct result
    By Snelms in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-14-2014, 03:48 PM
  2. NETWORKDAYS and producing future dates
    By mikaselm in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-05-2014, 06:32 PM
  3. [SOLVED] Networkdays formula - negative result
    By Lukael in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-27-2014, 03:47 PM
  4. [SOLVED]Formula producing wrong result
    By tobu56 in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 10-26-2013, 08:59 PM
  5. rand function producing negative numbers
    By nabilqu in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-25-2008, 04:04 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