Formualizer Docs

OCT2BIN

Converts an octal text value to binary text.

Supports optional left-padding through the places argument.

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

=OCT2BIN(number, [places])

Arguments

ArgumentTypeRequiredDefault
numbernumberRequired—
placesnumberOptional—

Return type

Can return text.

Remarks

  • Input must be octal text up to 10 digits and may be signed two's-complement.
  • places must be at least the output width and at most 10, or #NUM! is returned.

Error cases

  • Converted values must fall in [-512, 511], or the function returns #NUM!.

Examples

Convert octal 36 with no output padding.

Formula =OCT2BIN("36")

Expected result 11110

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

Use eight output characters to preserve leading zeros.

Formula =OCT2BIN("36",8)

Expected result 00011110

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 zero with a one-place width.

Formula =OCT2BIN("0",1)

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 input contains a digit outside base eight.

Formula =OCT2BIN("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 octal to binary

Formula =OCT2BIN("77")

Expected result 111111

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 signed octal

Formula =OCT2BIN("7777777777")

Expected result 1111111111

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 OCT2BIN return #NUM! for some octal inputs?

After decoding, the value must be within [-512, 511] to be representable in Excel-style binary output.

Implementation

Engine source

On this page