Walter Hildebrandt wrote:
Sorry for not being completely clear in what I have ask.
When in A1 there is 1.61 and in B1 there is 1.36. In C1 the original
formula =A1-B1)/B1 gives the answer of 18%. The formula =IF(A1-B1 <
0;0;A1-B1) gives the wrong answer of 25% in C1
When in A1 there is 23 and in B1 there is 33 In C1 the original formula
=A1-B1)/B1 gives the answer of -30%. The formula =IF(A1-B1 < 0;0;A1-B1)
gives the wrong answer of 0% in C1
If there is a negative number in either A1 or B1, then C1 should be empty
(C1 should not have a 0% in it)
=IF(B1=0;"";(IF((A1-B1)/B1>0;(A1-B1)/B1;""))) will give you an empty
cell in C1 if the RESULT of the equation is negative.
Note that if both A1 and B1 contain negative numbers the result can
still be a positive number in C1; ie. -2 and -1 gives (-1 plus -2)
yielding -3. -3/-2=1.5. If all you want to test for is a negative
RESULT of the equation, the above formula will work.
--
Gene Y.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]