Formualizer Docs

OCT2DEC

Converts an octal text value to decimal.

Supports up to 10 octal digits, including signed two's-complement values.

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

=OCT2DEC(number)

Arguments

ArgumentTypeRequiredDefault
numberanyRequired—

Remarks

  • Input is coerced to text and must contain only digits 0 through 7.
  • 10-digit values beginning with 4-7 are interpreted as signed 30-bit numbers.

Error cases

  • Returns #NUM! for invalid characters or inputs longer than 10 digits.

Examples

Convert two octal digits into a decimal number.

Formula =OCT2DEC("52")

Expected result 42

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

Read a signed ten-digit octal value.

Formula =OCT2DEC("7777777777")

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

Convert the base-eight representation of zero.

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

The digit 8 is outside base eight.

Formula =OCT2DEC("8")

Expected result #NUM!

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

Convert positive octal

Formula =OCT2DEC("17")

Expected result 15

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

How does OCT2DEC interpret 10-digit values starting with 4-7?

Those are treated as signed 30-bit two's-complement octal values.

Implementation

Engine source

On this page