BIN2OCT function

Converts a binary number to octal.

Syntax

BIN2OCT(number,places)

Argument

Description

Remarks

number

The binary number that you want to convert. The number argument cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation.

  • If number is not a valid binary number, or if number contains more than 10 characters (10 bits), this function returns the #NUM! error value.

  • If number is negative, this function ignores places and returns a 10-character number.

places

The number of characters to use. The places argument is useful for padding the return value with leading 0s (zeros).

  • If this argument is omitted, this function uses the minimum number of characters necessary.

  • If this function requires more than places characters, it returns the #NUM! error value.

  • If this argument contains a decimal value, this function ignores the numbers to the right side of the decimal point.

  • If this argument is nonnumeric, this function returns the #VALUE! error value.

  • If this argument is negative, this function returns the #NUM! error value.

Example

To make the following example easier to understand, you can copy the data to a blank sheet and then enter the function underneath the data. Do not select the row or column headings (1, 2, 3... A, B, C...) when you copy the sample data to a blank sheet.

1
2
3
4
AB
FormulaDescription (Result)
=BIN2OCT(1001,3)Converts binary 1001 to octal with 3 characters (011)
=BIN2OCT(1100100)Converts binary 1100100 to octal (144)
=BIN2OCT(1111111111) Converts binary 1111111111 to octal (7777777777)
Rate this content:
Not helpfulSomewhat helpfulHelpfulVery helpfulSolved my problem 
 
Share your feedback about this topic