BIN2OCT function

BIN2OCT(Number, DigitCount?) BIN2OCT(Number; DigitCount?)

Number

Text or { Text }

A binary number.

DigitCount

Number or { Number } (optional)

The number of digits to return. If omitted, the minimum number of digits necessary to accurately represent the number is used.

Returns

Text or { Text }

An octal number.

Converts a binary number to an octal number. Also consider using the more general functions BASE and DECIMAL. Perform the reverse conversion using OCT2BIN.

Examples

BIN2OCT("101")BIN2OCT("101")

Returns "5".

BIN2OCT("101", 4)BIN2OCT("101"; 4)

Returns "0005".

BIN2OCT("01111011")BIN2OCT("01111011")

Returns "173".

BASE(DECIMAL("01111011", 2), 8)BASE(DECIMAL("01111011"; 2); 8)

Returns "173".

BIN2OCT({ "101", "01111011" })BIN2OCT({ "101"; "01111011" })

Returns the array { "5", "173" }{ "5"; "173" }.