Formualizer Docs

SIGN

Returns the sign of a number as -1, 0, or 1.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=SIGN(number)

Arguments

ArgumentTypeRequiredDefault
numbernumberRequired—

Remarks

  • Returns 1 for positive numbers.
  • Returns -1 for negative numbers.
  • Returns 0 when input is zero.

Examples

Evaluate a negative number with a fractional part.

Formula =SIGN(-4.7)

Expected result -1

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Compare the result on the positive side of zero.

Formula =SIGN(4.7)

Expected result 1

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Evaluate the function at the zero boundary.

Formula =SIGN(0)

Expected result 0

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A nonnumeric text value cannot be used as the number.

Formula =SIGN("invalid")

Expected result #VALUE!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Positive input

Formula =SIGN(12)

Expected result 1

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Negative input

Formula =SIGN(-12)

Expected result -1

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

Can SIGN return anything other than -1, 0, or 1?

No. After numeric coercion, the output is always exactly -1, 0, or 1.

Implementation

Engine source

On this page