The Microsoft Excel BIN2OCT function converts a binary number to an octal number. The BIN2OCT function is a built-in function in Excel that is categorized as an Engineering Function. It can be used as a worksheet function (WS) in Excel. As a worksheet function, the BIN2OCT function can be entered as part of a formula in a cell of a worksheet.
Syntax: BIN2OCT(number, [places])
The BIN2OCT function syntax has the following arguments:
- Number Required. The binary number you want to convert. Number 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.
Places Optional. The number of characters to use. If places is omitted, BIN2OCT 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 BIN2OCT function examples and explore how to use the BIN2OCT function as a worksheet function in Microsoft Excel:
Based on the Excel spreadsheet above, the following BIN2OCT 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 [places] number is not an integer, it is truncated by the function.
- The input number must be a valid binary numeric number.
- If the input number has less than 10 digits, the function takes 0s to the left of the number to complete its 10 character binary value.
- 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.
- The function returns the #NUM! Error
- If the input characters exceed by 10 digits.
- If the input number is not a valid binary expression.
- If the input number have fraction part or decimal part for example: 010111.101