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:
Based on the Excel spreadsheet above, the following OCT2BIN examples would return:
- Numbers can be given as argument to the function directly without quotes or cell reference in excel.
- The function doesn’t consider the [places] number in case of a negative decimal number.
- 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.
- If the input [places] number is not an integer, it is truncated by the function.
- The function returns the binary value for the max value of 111111111 & minimum value upto 1000000000 (only integers).
- The function returns the #NUM! Error
- If the input octal number is less than 7777777000 or greater than 777.
- If the input number [places] is zero or negative.
- If the input number [places] is not sufficient for the resulting positive binary number.
- The function returns the #VALUE! Error
- If the input number is text or non-numeric.
- If the input [places] number is text or non-numeric.