Calc OCT2BIN function

Converts an octal number to binary.

Help CentreFunctions & Formulas

For a full list of available calculation functions, please read What calculation functions are supported.

This article describes the formula syntax and usage of the OCT2BIN function.


Description

Converts an octal number to binary.


Syntax

OCT2BIN(number, [places])


The OCT2BIN function syntax has the following arguments:
  • number - Required. The octal number you want to convert. The number cannot contain more than 10 characters (the most significant bit is the sign bit).
  • places - Optional. The number of characters to use. If places is omitted, the minimum number of characters necessary to represent the binary number is used. If places is specified and is greater than the length of the converted binary number, the result is padded with leading zeros. If places is specified and is less than the length of the converted binary number, the #NUM! error value is returned.

Remarks

  • Number is interpreted as a signed number in octal notation. Valid numbers are from 0 to 7777777777 (octal), which is equivalent to 0 to 536870911 (decimal) for positive numbers, and from -1 to -2000000000 (octal), which is equivalent to -1 to -536870912 (decimal) for negative numbers.
  • If number is not a valid octal number, OCT2BIN returns the #NUM! error value.
  • If number is negative, OCT2BIN uses two's-complement notation to represent the binary number.

Example

FormulaDescriptionResult
=OCT2BIN(17)Converts octal 17 to binary.1111
=OCT2BIN(17, 8)Converts octal 17 to binary, using 8 characters.00001111
=OCT2BIN(-17)Converts negative octal 17 to binary.11111111111111111111111111101111
=OCT2BIN(-17, 8)Converts negative octal 17 to binary, using 8 characters.11101111

Errors

For a full list of formula errors, please read Formula errors.


Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.