+ Reply to Thread
Results 1 to 4 of 4

Multi-Conditional IF Statements

  1. #1
    stacy
    Guest

    Multi-Conditional IF Statements

    Hello...

    I have a dilemma that I may be making harder than it needs to be. I
    have a spreadsheet with 3 columns, contain 3 specific dates. What I
    need to do is to compare these columns, and calculate the NETWORKDAYS
    between dates. The problem is this: If column C is blank, then I want
    the NETWORKDAYS between columns A and B. If column C is filled, I want
    the NETWORKDAYS between columns A and C. I can get either the first
    sequence or the second sequence to work fine, but not both at the same
    time. My main issue I believe is when calculating the NETWORKDAYS...
    If column A is larger than column B, no problem. But if column B is
    larger than column A, it returns a negative value, which is what I
    want, but the calculation is off. Below is the date I am using...

    SLA Date Production Date Deliverable Date Net-Work Days SLA Made by
    03/10/06 03/03/06 5
    03/08/06 03/09/06 -1
    03/09/06 03/09/06 0
    03/15/06 03/09/06 03/22/06 FALSE

    =IF(F6="",IF(E6<D6,NETWORKDAYS(E6,D6,$M$6:$M$14)-1,IF(E6>D6,NETWORKDAYS(E6,D6,$M$6:$M$14)+1,IF(E6=D6,NETWORKDAYS(E6,D6,$M$6:$M$14)-1))))

    The problem is that the formula I use above works great, until column C
    is populated, and then I get a FALSE return due to my IF(F6=""
    statement (F6 is the deliverable date column in the example above). Is
    there an easier way to account for both this column being blank and/or
    filled?

    Thanks ahead of time for any help.


  2. #2
    stacy
    Guest

    Re: Multi-Conditional IF Statements

    Okay... I think I have figured out my own question... I use the
    following formula and it works just fine:

    =IF(AND(F6="",E6<D6),NETWORKDAYS(E6,D6,M$6:M$14)-1,IF(AND(F6="",E6>D6),NETWORKDAYS(E6,D6,M$6:M$14)+1,IF(AND(F6="",E6=D6),"0",IF(F6<>"",NETWORKDAYS(F6,D6,M$6:M$14)+1,0))))

    However, if anyone has something a little more direct or simple, I am
    always open to learning new approaches! Thanks for your time...


  3. #3
    MarkTheNuke
    Guest

    Re: Multi-Conditional IF Statements

    You could use the IsBlank function
    =IF(AND(ISBLANK(F6),E6<D6)....
    I don't know if it will save you anything but you could try it.
    Mark

    "stacy" wrote:

    > Okay... I think I have figured out my own question... I use the
    > following formula and it works just fine:
    >
    > =IF(AND(F6="",E6<D6),NETWORKDAYS(E6,D6,M$6:M$14)-1,IF(AND(F6="",E6>D6),NETWORKDAYS(E6,D6,M$6:M$14)+1,IF(AND(F6="",E6=D6),"0",IF(F6<>"",NETWORKDAYS(F6,D6,M$6:M$14)+1,0))))
    >
    > However, if anyone has something a little more direct or simple, I am
    > always open to learning new approaches! Thanks for your time...
    >
    >


  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You should be able to simplify so that NETWORKDAYS isn't repeated, try

    =IF(E6=D6,0,NETWORKDAYS(IF(F6,F6,E6),D6,M$6:M$14)-SIGN(D6-IF(F6,F6,E6)))

+ 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