No negatives, Newbie

D

djarcadian

I have the following function in my spreadsheet

=SUM(D10+E10-20)

However, should the math result in a negative number I want it t
display zero instead. How would I accomplish this
 
S

Sandy Mann

scottymelloty has given you a working answer but I would say that either
your SUM or + are superfluous. SUM() will add everything in the brackets
without the need for any other signs. If the cells are contiguous use
=SUM(D10:E10) or if they are not contiguous you can use SUM(A1,C3,D5) etc.

I would therefore write if as =IF(SUM(D10:E10)>20,0,SUM(D10:E10))

or Max(0,sum(D10:E10))

HTH

Sandy
 
A

Andre Croteau

I would modify Dana DeLouis' formula to include the negative restriction:
=max(0,min(D10+E10,20))

André
 
Top