No negatives, Newbie

  • Thread starter Thread starter djarcadian
  • Start date Start date
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
 
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
 
I would modify Dana DeLouis' formula to include the negative restriction:
=max(0,min(D10+E10,20))

André
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top