+ Reply to Thread
Results 1 to 8 of 8

Help with IF formula (and maybe (OR) is needed?)

  1. #1
    Registered User
    Join Date
    11-01-2006
    Posts
    10

    Question Help with IF formula (and maybe (OR) is needed?)

    I really am stumped and am not that great with the IF formulas yet. If anyone can help I would really appreciate it.

    This is what I got....

    cell D3: date
    cell E3: date
    cell F3: =IF(OR(ISBLANK(D3),NETWORKDAYS(E3,D3)-1>2,),"No","Yes")

    What I need is this.....
    If the date in D3 is more than 1 business day after E3, then I need the result to be "Yes"
    If the date in D3 is 1 business day difference (or less), then I need the result to be "Yes"
    If cell D3 is blank, then I need the result to be "No"

    The issue I am facing with the formula I currently have is that if D3 has "3/20/2012" and E3 has "3/16/2012", the result should be NO.
    But I am getting a YES even though that is more than 1 business day. the formula does not properly recognize the business days for some reason.

    help??
    Last edited by mgilmore77; 03-21-2012 at 11:47 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Help with IF formula (and maybe (OR) is needed?)

    Looks like you have an extra comma:

    cell F3: =IF(OR(ISBLANK(D3),NETWORKDAYS(E3,D3)-1>2,),"No","Yes")

    Try:

    cell F3: =IF(OR(ISBLANK(D3),NETWORKDAYS(E3,D3)-1>2),"No","Yes")


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Help with IF formula (and maybe (OR) is needed?)

    NETWORKDAYS excludes weekends (Saturdays and Sundays).
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Help with IF formula (and maybe (OR) is needed?)

    Ι think, this is giving your request.

    =IF(OR(ISBLANK(D3);NETWORKDAYS(E3;D3)-1>1);"No";"Yes")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Registered User
    Join Date
    11-01-2006
    Posts
    10

    Re: Help with IF formula (and maybe (OR) is needed?)

    Quote Originally Posted by ConneXionLost View Post
    NETWORKDAYS excludes weekends (Saturdays and Sundays).
    Yeah, this is what I need because I don't want the formula to count Saturday and Sunday as business days. But for some reason the formula I was using was counting the difference between Friday thru Tuesday as 1 business day instead of 2.

  6. #6
    Registered User
    Join Date
    11-01-2006
    Posts
    10

    Re: Help with IF formula (and maybe (OR) is needed?)

    Quote Originally Posted by TMShucks View Post
    Looks like you have an extra comma:

    cell F3: =IF(OR(ISBLANK(D3),NETWORKDAYS(E3,D3)-1>2,),"No","Yes")

    Try:

    cell F3: =IF(OR(ISBLANK(D3),NETWORKDAYS(E3,D3)-1>2),"No","Yes")


    Regards, TMS
    Thanks! : ) Didn't catch that....still isn't coming up with the right result still....still counts Friday to Tuesday as one business day....I think we added the "-1" part before the ">2" part because it was counting Friday itself as a day, so this took that away. But still not getting it.

  7. #7
    Registered User
    Join Date
    11-01-2006
    Posts
    10

    Re: Help with IF formula (and maybe (OR) is needed?)

    Quote Originally Posted by Fotis1991 View Post
    Ι think, this is giving your request.

    =IF(OR(ISBLANK(D3);NETWORKDAYS(E3;D3)-1>1);"No";"Yes")
    Appreciate the help so much, thanks!
    Unfortunately this still is not fixing the issue....I gotta do some more digging.

  8. #8
    Registered User
    Join Date
    11-01-2006
    Posts
    10

    Re: Help with IF formula (and maybe (OR) is needed?)

    Okay, it appears this is what I needed (one of our Excel gurus finally figured it out):

    =IF(D3="","No",IF(NETWORKDAYS(E3,D3)>2,"No","Yes"))

    Thanks everyone!

+ 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