2009/11/11 Gene Young <[email protected]>: > Walter Hildebrandt wrote: >> >> On Wed, Nov 11, 2009 at 10:00 AM, Gene Young <[email protected]> wrote: >> >>> Walter Hildebrandt wrote: >>> >>>> I have the following formula: >>>> >>>> IF*(**ISBLANK(A1)*;*"Empty"*;IF*(A1=0*;*"no >>>> Div"*;A1-40+STYLE(IF*(A1>40*; >>>> "RedText")))) >>>> >>>> The syntax of an IF consists of three components: >>>> >>>> 1. >>>> >>>> *The condition* >>>> 2. >>>> >>>> *What to do if the condition is true* >>>> 3. >>>> >>>> *What to do if the condition is false* >>>> >>>> >>>> What is the syntax is the above formula? Where is the *false condition* >>>> for >>>> the *(**ISBLANK(A1) >>>> >>> IF*(A1=0*;*"no Div"*;A1-40+STYLE(IF*(A1>40*;"RedText") >>> >>> Am I correct that you are saying that >>> A1-40+STYLE(IF*(A1>40*;"RedText"))))is the #3 False condition for both >>> (ISBLANK(A1) and (A1=0) >> >> Am I correct that you are saying "RedText" is the #3 False condition for >> (A1>40 even where it seems to be the #2 True condition since there is only >> one condition after the (A1>40 >> > My apologies. I failed to notice that you left out a condition. You needto > change the last if statement to add the false condition: > > IF*(A1>40*;"RedText";"") > > This states that if your condition is true, "RedText" if it is false, null. > You could of course put any other action in for false, but you must have > the else condition. >
Or maybe this makes it easier to understand: IF(A1>40;"RedText";"Default") The whole formula: IF(A1=0;"no Div";A1-40+STYLE(IF(A1>40;"RedText";"Default"))) The ; separates the three parts of the if. In this case: IF(1;2;3(IF(4;5;6))) 1 → A1=0 (condition) 2 → "no Div" (if 1 → true) 3 → A1-40+STYLE(IF(A1>40;"RedText";"Default")) (if 1 → false) 4 → A1>40 (condition) 5 → "RedText" (if 4 → true) 6 → "Default" (if 4 → false) Johnny Rosenberg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
