Multi-Conditional IF Statements

S

stacy

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

stacy

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

MarkTheNuke

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
 
D

daddylonglegs

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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top