Example 1
Direction of change: up
D2 =SIGN(C2-B2)
Result: 1
Gloves went up by 10, so the sign is 1.
D2 =SIGN(C2-B2) returns 1
Returns 1 for a positive number, -1 for a negative number and 0 for zero. It tells you the direction, not the size.
Syntax
=SIGN()
All versions of Excel.
Try it
Edit the formula in D2 or change the inputs. The sheet recalculates as you type.
D2 =SIGN(C2-B2) returns 1
SIGN reports which side of zero a number is on. It returns 1 for anything positive, -1 for anything negative, and 0 for zero. The size of the number makes no difference: SIGN(0.001) and SIGN(5000) are both 1.
The common use is to turn a difference into a direction. With last month in B2 and this month in C2, =SIGN(C2-B2) is 1 for an increase, -1 for a decrease and 0 for no change. That is easier to count, colour or look up than the raw difference.
Because SIGN gives only three possible numbers, it works well as an index into a list. =CHOOSE(SIGN(C2-B2)+2, "Down", "Flat", "Up") adds 2 so -1, 0 and 1 become 1, 2 and 3. The same result comes from nested IFs, but the CHOOSE form is shorter and easy to extend.
SIGN lets you count increases and decreases without helper columns. =SUMPRODUCT(--(SIGN(C2:C9-B2:B9)=1)) counts rows that went up. The sum of the signs, =SUMPRODUCT(SIGN(C2:C9-B2:B9)), is the number of rises minus the number of falls: a quick way to see whether a series is trending up or down.
=SIGN(B2)*ABS(C2) gives C2's size with B2's sign.=-SIGN(B2).=SIGN(B2)*ABS(B2) equals B2.ABS returns the size and drops the direction. SIGN returns the direction and drops the size. Between them you can recover the original number.
SIGN of text returns #VALUE!, and SIGN of a blank cell is 0. For a blank cell that should not count as "no change", check it with ISBLANK first. Dates are numbers, so =SIGN(A2-TODAY()) tells you whether a deadline is in the past (-1), today (0) or in the future (1).
C2-B2.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
D2 =SIGN(C2-B2)
Result: 1
Gloves went up by 10, so the sign is 1.
D2 =SIGN(C2-B2) returns 1
Example 2
D3 =SIGN(C3-B3)
Result: 0
Tape is unchanged at 80, so the difference and the sign are both 0.
D3 =SIGN(C3-B3) returns 0
Example 3
D4 =SIGN(C4-B4)
Result: -1
Labels fell by 15. The size of the fall doesn't matter to SIGN.
D4 =SIGN(C4-B4) returns -1
Example 4
D4 =CHOOSE(SIGN(C4-B4)+2,"Down","Flat","Up")
Result: Down
SIGN gives -1, which plus 2 is position 1 in the list.
D4 =CHOOSE(SIGN(C4-B4)+2,"Down","Flat","Up") returns Down
Example 5
B8 =SUMPRODUCT(--(SIGN(C2:C6-B2:B6)=1))
Result: 2
Gloves and Wrap went up. The double minus turns TRUE and FALSE into 1 and 0 so SUMPRODUCT can add them.
B8 =SUMPRODUCT(--(SIGN(C2:C6-B2:B6)=1)) returns 2
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In D2, return 1 if Q2 is above Q1, -1 if it is below and 0 if it is the same. Fill it down to D6.
Answer in D2, then it fills down to D6.
#VALUE! and breaks it.SIGN(C2-B2) return #VALUE!, and the error spreads to every cell built on it. Clean the data first.It returns 1 for a positive number, -1 for a negative number and 0 for zero. SIGN(-45) is -1.
Use `=SIGN(C2-B2)` with the earlier figure in B2 and the later one in C2. 1 means up, -1 means down and 0 means unchanged.
Use `=CHOOSE(SIGN(C2-B2)+2, "Down", "Flat", "Up")`. Adding 2 turns -1, 0 and 1 into the list positions 1, 2 and 3.
SIGN returns the direction as 1, -1 or 0. ABS returns the size without the sign. Multiplying them, SIGN(x)*ABS(x), gives back x.
Use `=SIGN(A2-TODAY())`. It is -1 for a past date, 0 for today and 1 for a future date.
Tracks take you from the basics to modelling, one graded exercise at a time.