Get the sign of a number
=SIGN(number)
| Parameter | Description |
|---|---|
number |
The number to get the sign of. |
=SIGN(5) // returns 1
=SIGN(-3) // returns -1
=SIGN(0) // returns 0
SIGN can be used to change negative numbers into positive values like this. For example, with -3 in cell A1, the formula below returns 3:
=A1*SIGN(A1)
=-3*-1
=3
The formula above has no effect on positive numbers, since SIGN will return 1. However, the ABS function provides a simpler solution:
=ABS(A1) // absolute value of A1