x=...
y=...
5*(x-y)=
if "x" and "y" are with different signs (-/+ or +/-) the formula should be like that,
but if "x" and "y" are with same signs (-/- or +/+) in the brackets should stay only one value with his sign - the absolute value of (x and y).
How should it look like?
If I understand your question correctly, you can use this formula:
=5*IF(SIGN(A2)=SIGN(B2),IF(SIGN(A2)=1,MAX(A2,B2),MIN(A2,B2)),A2-B2)
How it works:
IF(SIGN(A2)=SIGN(B2)
- if signs are the same
IF(SIGN(A2)=1
- if numbers are positiveMAX(A2,B2)
- returns bigger numberMIN(A2,B2)
- returns smaller number (bigger absolute value for negative numbers mean smaller number)A2-B2
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句