Formualizer Docs

ODD

Rounds a number away from zero to the nearest odd integer.

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

=ODD(number)

Arguments

ArgumentTypeRequiredDefault
numbernumberRequired—

Remarks

  • Values already equal to an odd integer stay unchanged.
  • Positive and negative values both move away from zero.
  • 0 returns 1.

Examples

Evaluate a negative number with a fractional part.

Formula =ODD(-4.7)

Expected result -5

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 =ODD(4.7)

Expected result 5

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 =ODD(0)

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?.

A nonnumeric text value cannot be used as the number.

Formula =ODD("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?.

Round a positive number to odd

Formula =ODD(2)

Expected result 3

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?.

Round a negative number away from zero

Formula =ODD(-1.1)

Expected result -3

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

Why does ODD(0) return 1?

ODD rounds away from zero to the nearest odd integer, so zero maps to positive one.

Implementation

Engine source

On this page