Reputation: 327
How do I Make a range of Cells to Zero If a calculation gives A Negative Number?
Example: =D12-D19
Answer: -1
I would like to replace the negative to zero.
Upvotes: 2
Views: 9626
Reputation: 170178
Try this:
=IF(SUM(A1:A5) < 0, 0, SUM(A1:A5))
or depending on your locale:
=IF(SUM(A1:A5) < 0; 0; SUM(A1:A5))
which means:
IF the sum of the cells A1 + A2 + A3 + A4 + A5 is less than 0
make it 0
ELSE
make it the sum of the cells A1 + A2 + A3 + A4 + A5
Upvotes: 1