BIN2OCT

BIN2OCT(number, places)

Returns the number converted from binary to octal.

number The binary number you want to convert.
placesThe number of characters to use.

REMARKS
* If "number" contains more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits.
* If "number" contains 10 characters then the most significant bit (i.e. the first number) represents the sign bit (i.e. either positive or negative).
* If "number" contains more than 10 characters (10 bits), then #NUM! is returned.
* If "number" < 0 then two's-complement notation is used to represent the number.
* If "number" < 0, then "places" is ignored and a 10-character octal number is returned.
* If "number" is not a valid binary number, then #NUM! is returned.
* If "places" is less than the number of characters needed, then #NUM! is returned.
* If "places" is left blank, then the minimum number of characters necessary.
* If "places" is not an integer, it is truncated.
* If "places" is not numeric, then #VALUE! is returned.
* If "places" < 0, then #NUM! is returned.
* The "places" is useful for padding the return value with leading 0s.
* You can use the BIN2DEC function to convert a number from binary to decimal.
* You can use the BIN2HEX function to convert a number from binary to hexadecimal.
* You can use the OCT2BIN function to convert a number from octal to binary.
* The equivalent VBA function is VBA.OCT
* For the Microsoft documentation refer to support.microsoft.com
* For the Google documentation refer to support.google.com

 A
1=BIN2OCT(1) = 1
2=BIN2OCT(10) = 2
3=BIN2OCT(100) = 4
4=BIN2OCT(111) = 7
5=BIN2OCT(10001) = 21
6=BIN2OCT(100000000) = 400
7=BIN2OCT(1100000000) = 7777777400
8=BIN2OCT(1111111111) = 7777777777
9=BIN2OCT(1111111110) = 7777777776
10=BIN2OCT(1111111101) = 7777777775
11=BIN2OCT(1111111111) = 7777777777
12=BIN2OCT(1001, 3) = 011
13=BIN2OCT(1100100) = 144
14=BIN2OCT(-10) = #NUM!
15=BIN2OCT(123456789012) = #NUM!
16=BIN2OCT("some text") = #NUM!


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top