+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    03-19-2010
    Location
    Pennsylavania, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    IF and NOT function question

    I need help with a nested IF function. What I am trying to do is if J9 is blank and if K9 is not blank then I want it to be 0, other wise I want the networkdays between J9 and M9 minus our list of Holidays.

    My current formulas is

    =IF((J9=""),0,IF(NOT(K9=""),0,NETWORKDAYS(J9,M9,Holiday))-1)

    This is working where K9 is blank but if K9 has a date I am getting -1 where it should be 0.

  2. #2
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,740

    Re: IF and NOT function question

    What is this -1?

    You can try use this: =IF(J9="", 0, IF(K9="", MAX(0,NETWORKDAYS(J9,M9,Holiday))-1, 0))
    Last edited by zbor; 03-19-2010 at 10:20 AM.
    "Relax. What is mind? No matter. What is matter? Never mind!"

  3. #3
    Registered User
    Join Date
    03-19-2010
    Location
    Pennsylavania, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: IF and NOT function question

    The -1 has something to do with no figuring in the weekend. I found this last year and really do not remember the reason behind it but it works for what I need and I tried your formula and it seems to work. Thanks for your help.

  4. #4
    Forum Guru zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    5,740

    Re: IF and NOT function question

    But it won't give you -1

    What do you need if you take for example same date in J9 and M9 and it's sunday?
    "Relax. What is mind? No matter. What is matter? Never mind!"

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.2.0