Help with a formula

  • Thread starter Lee and Rebecca
  • Start date
L

Lee and Rebecca

The formula I'm trying to use is =I17-40.
Can I write the formula so that the cell will show a zero if the result of
the formula is less than zero? In other words, show zero if the result of the
formula is in the negative.
Please e-mail Lee at [email protected] if you can help. Thanks.
 
M

Michael Cantinotti

Hi,

Try

=IF(J1<=0;0;J1)

Example :

I J K

12 -28 0
22 -18 0
45 5 5
56 16 16

I = your numbers
J = I - 40
K displays 0 if I-40 =< 0, else it displays the result in J

HTH


Michael
 
D

Dave Peterson

=max(0,i17-40)

is another alternative.

if I17 held 80, then it's the same as
=max(0,80-40)
or
=max(0,40)
or
40

If I17 held 20, then
=max(0,20-40)
=max(0,-20)
0
 
G

Gord Dibben

=MAX(0,(I17-40))

Gord Dibben Excel MVP


On Sat, 6 Nov 2004 08:10:01 -0800, Lee and Rebecca <Lee and
 
Top