Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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(E6D6,NETWORKDAYS(E6,D6,$M$6:$M$14)+1,IF(E6=D 6,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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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="",E6D6),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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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="",E6D6),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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multi-Conditional IF Statements
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)) -- daddylongleg ----------------------------------------------------------------------- daddylonglegs's Profile: http://www.excelforum.com/member.php...fo&userid=3048 View this thread: http://www.excelforum.com/showthread.php?threadid=52542 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multi-column conditional formatting | Excel Discussion (Misc queries) | |||
Multi-conditional count | Excel Worksheet Functions | |||
Multi-Conditional Functions | Excel Worksheet Functions | |||
multi conditional searching | Excel Worksheet Functions | |||
Multi-conditional sum with VBA code ?? | Excel Programming |