How to set "0" if the cell value is negative?
valphi63
Posted messages
8
Status
Member
-
valphi63 Posted messages 8 Status Member -
valphi63 Posted messages 8 Status Member -
You can use the MAX function in your formula to ensure that the cell displays "0" instead of a negative number. For example, if your current formula is `=A1-B1`, you can modify it to `=MAX(0, A1-B1)`. This will return "0" if the result of `A1-B1` is negative.
3 answers
-
Hello
=IF(formula=0,0,formula)
or shorter:
=MAX(formula,0)
Thanks
--
The quality of the answer largely depends on the clarity of the question, thank you!-
Hello Vaucluse. So your answer did not solve my problem because I was probably not precise enough in my question.
Here’s what I did:
In cell D21, I put the formula =B19-C19 and according to this formula I have a positive result. Now, I’m trying to create a formula in cell C21 that goes as follows: =C19-B19 and I necessarily get a negative value. However, I would like in my formula whose value is negative to somehow make the value visible in cell C21 as "0".
Thank you for your valuable advice and have a nice day.
-