The Excel BIN2DEC function converts a binary number to the decimal equivalent. The input number must contain only zeros and ones and be less than 10 characters long, otherwise the function returns the #NUM! error value.
Syntax: =BIN2DEC (number)
The BIN2DEC 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.
Example: Let’s look at some Excel BIN2DEC function examples and explore how to use the BIN2DEC function as a worksheet function in Microsoft Excel:
Based on the Excel spreadsheet above, the following BIN2DEC examples would return:
- Numbers can be given as argument to the function directly without quotes or cell reference in excel.
- The 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 max value of 511 & minimum value upto -512 (only integers).
- 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 value is text or non-numeric.
- If the input number have fraction part or decimal part for example: 010111.101