IF Function and a formula

F

Fred Atkinson

I need to use the IF function to prevent a value from dropping
below zero. What I've tried with Excel doesn't seem to work for me.

I'll represent the formula by <FORMULA>. What I am trying to
do is illustrated by:

IF <FORMULA> gt 0 then cell=<FORMULA>
IF <FORMULA> eq 0 then cell=0
IF <FORMULA> lt 0 then cell=0

All of this should take place within the same cell and yield a
value. If this is done right, the value displayed in the cell should
never be less than zero.

Regards,



Fred
 
R

Ron Coderre

Try something like this:

=MAX(your_formula,0)

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
F

Fred Atkinson

I tried that. For some reason, it doesn't like the function I
am using.

But the previous post worked.

Thanks for your suggestion.



Fred Atkinson
 
F

Fred Atkinson

Ron,

What about if I have something like this?:

IF (Y>0) THEN =100*(X/Y)
IF (Y=0) THEN <leave cell blank>
IF (Y<0) THEN <leave cell blank>

In other words, instead of displaying ERR because I'm dividing
by zero, I just want to leave the cell blank.

What would be the best way to do this?



Fred
 
D

David Biddulph

=IF(Y<=0,"",100*(X/Y))
--
David Biddulph

Fred Atkinson said:
Ron,

What about if I have something like this?:

IF (Y>0) THEN =100*(X/Y)
IF (Y=0) THEN <leave cell blank>
IF (Y<0) THEN <leave cell blank>

In other words, instead of displaying ERR because I'm dividing
by zero, I just want to leave the cell blank.

What would be the best way to do this?

Fred
 
Top