Excel VBA Sgn Function

Facebooktwitterredditpinterestlinkedinmailby feather

VBA Sgn Function: The Sgn function in VBA returns an integer (+1, 0, or -1), stating the arithmetic sign for the specified number.

Syntax

Parameter

Number (required) –This parameter represents the number that you want the arithmetic sign of.

Return

This function returns an integer (+1, 0, or -1), stating the arithmetic sign for the specified number.

Example 1

Output

1

VBA Sgn Function

Example 2

Output

-1

VBA Sgn Function

Example 3

Output

0

VBA Sgn Function
Facebooktwitterredditpinterestlinkedinmailby feather