Author: Oscar Cronquist Article last updated on August 30, 2018

The SGN function returns an integer that shows the sign of the number.

Argument SGN returns
Number greater than 0 (zero). 1
Number equal to 0 (zero). 0
Number less than 0 (zero). -1

Excel Function VBA Syntax

SGN(number)

Arguments

number Required. Any valid numeric expression. If number is 0 (zero) then 0 (zero) is returned.

Comments

I used the following macro to show how the SGN function behaves with different numerical values demonstrated in the picture above.

Sub Macro1()
   For Each cell In Range("B3:B12")
       cell.Offset(, 1) = SGN(cell.Value)
    Next cell
End Sub