Maybe I misunderstood the question, but what if both A1 and B1 are negative? If that also should give a blank C1, the formula you got was correct (I guess, I didn't study it closer, but it looks correct). However, you can obtain the same thing with the OR function and it might look a little bit more straight forward: =IF(OR(A1<0;B1<0);"";(A1-B1)/B1)
This means (and this is only for a quick explanation, you can't enter it this way, of course): IF A1<0 OR B1<0 THEN "" ELSE (A1-B1)/B1 Johnny Rosenberg 2009/5/31 Walter Hildebrandt <[email protected]>: > Thank you, Keith, the complicated formula > =IF(A1<0;"";IF(B1<0;"";(A1-B1)/B1) works great. > > Walter > > On Sat, May 30, 2009 at 11:29 PM, Keith N. McKenna < > [email protected]> wrote: > >> >>>> >>>> >>>> >>>> >>> Walter; >> Sorry about that I misread your original message. Let me see if I have >> this straight. In the example of A= 23 and be = 33 you want the result in C >> to be the -.30 but if either A or B is a negative number you want the result >> in C to be blank. Is that correct? If it is the following formula will do >> that, =IF(A1<0;"";IF(B1<0;"";(A1-B1)/B1)) I am sure there is an easier way, >> but I have tested it with your numbers and it does what you want I believe. >> If not please post again and I will give it another go. The formula first >> tests if A1 is a negative number, if it is it sets C1 to blank, If it isn't >> it tests if B1 is negative and it it is sets C1 to blank. Finally if neither >> are negative, it sets C1 = (A1-B1)/B1 >> >> Regards >> >> Keith >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
