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:
Syntax: =BIN2DEC(A2)
Result:
Based on the Excel spreadsheet above, the following BIN2DEC examples would return:
Syntax: =BIN2DEC(A3)
Result: 2
Syntax: =BIN2DEC(A4)
Result: 4
Syntax: =BIN2DEC(A5)
Result: 7
Syntax: =BIN2DEC(A6)
Result: 100
Syntax: =BIN2DEC(A7)
Result: 511
Syntax: =BIN2DEC(A8)
Result: 508
Syntax: =BIN2DEC(A9)
Result: 510
Syntax: =BIN2DEC(A10)
Result: -342
Syntax: =BIN2DEC(A11)
Result: 5
Syntax: =BIN2DEC(A12)
Result: #NUM!
Syntax: =BIN2DEC(A13)
Result: #NUM!
Note:
- 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