Reputation: 173
I have this two if functions:
=IF(C5<15;15-C5;0)
=IF(C5>15;C5-15;0)
Is it possible to join them into the same cell?
Thanks.
Upvotes: 0
Views: 86
Reputation: 50019
You could nest the if statements:
If(C5<15;15-C5;If(C5>15;C5-15;0))
Since both have 0
as the "Else" parameter (when the condition is false) you could add them together:
=IF(C5<15;15-C5;0) + IF(C5>15;C5-15;0)
Since it's just arithmetic you could get rid of the ifs:
=((C5<15)*(15-C5)) + ((C5>15)*(C5-15))
Also... this whole mess could be simplified down to just:
=ABS(C5-15)
Upvotes: 5