September 23, 2023

How to use OCT2BIN Function in Excel

The Excel Oct2Bin function converts an Octal (Base 8) number into a Binary (Base 2) number

Syntax:= OCT2BIN(number, [places])

The OCT2BIN function syntax has the following arguments:

  • Number    Required. The octal number you want to convert. Number may not contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two’s-complement notation.
  • Places    Optional. The number of characters to use. If places is omitted, OCT2BIN uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros).

Example: Let’s look at some Excel OCT2BIN function examples and explore how to use the OCT2BIN function as a worksheet function in Microsoft Excel:

OCT2BIN Function - How to use OCT2BIN Function in Excel

Syntax:  =OCT2BIN(A2)

Result:

OCT2BIN Function in Excel - How to use OCT2BIN Function in Excel

Based on the Excel spreadsheet above, the following OCT2BIN examples would return:

Syntax: =OCT2BIN(A3)
Result: 1000000

Syntax: =OCT2BIN(A4)
Result: 11001

Syntax: =OCT2BIN(A5)
Result: 1101

Syntax: =OCT2BIN(A6)
Result: 10000000

Syntax: =OCT2BIN(A7)
Result: 1110

Syntax: =OCT2BIN(A8)
Result: 1111111000

Syntax: =OCT2BIN(A9)
Result: 10011100

Syntax: =OCT2BIN(A10)
Result: 101010101

Syntax: =OCT2BIN(A11,B11)
Result: 011

Syntax: =OCT2BIN(A12,B12)
Result: 00000010

Syntax: =OCT2BIN(A13,B13)
Result: 10

Syntax: =OCT2BIN(A14,B14)
Result: 0111

Syntax: =OCT2BIN(A15,B15)
Result: 00001100

Note:

  1. Numbers can be given as argument to the function directly without quotes or cell reference in excel.
  2. The function doesn’t consider the [places] number in case of a negative decimal number.
  3. If the input octal number is negative it cannot be less than 7777777000 and if the number is positive it cannot be greater than 777.
  4. If the input [places] number is not an integer, it is truncated by the function.
  5. The function returns the binary value for the max value of 111111111 & minimum value upto 1000000000 (only integers).
  6. The function returns the #NUM! Error
    1. If the input octal number is less than 7777777000 or greater than 777.
    2. If the input number [places] is zero or negative.
    3. If the input number [places] is not sufficient for the resulting positive binary number.
  7. The function returns the #VALUE! Error
    1. If the input number is text or non-numeric.
    2. If the input [places] number is text or non-numeric.
READ:  How to use IMCOS Function in Excel

Leave a Reply

Your email address will not be published. Required fields are marked *