BIN2OCT

The BIN2OCT function converts a binary number to the corresponding octal number.

BIN2OCT(binary-string, convert-length)

binary-string: The string value representing the number to be converted. binary-string must contain only 0s and 1s.

convert-length: An optional number value specifying the minimum length of the number returned. convert-length must be in the range 1 to 32. If convert-length is omitted, it is assumed to be 1. If it is included, the number returned is padded with leading zeros, if necessary, so that it is at least the length specified by convert-length.

Notes

Examples

=BIN2OCT(“10011”) returns 23.

=BIN2OCT(“100111”, 3) returns 047.

=BIN2OCT(101101) returns 55.

=BIN2OCT(-101101) returns an error, as the minus sign is not permitted.

See also
BIN2DEC
BIN2HEX
DEC2OCT
HEX2OCT
OCT2BIN