How to Use Excel's BIN2DEC Function

By eHow Computers Editor

Rate: (0 Ratings)

Excel's BIN2DEC function converts a binary number (base 2) to a decimal number (base 10). This conversion is frequently needed in programming because machine language is in binary, but humans use the decimal system.

Instructions

Difficulty: Moderate

Step1
Learn the syntax for BIN2DEC. It's BIN2DEC(value) where value is the binary number to convert to decimal. Value cannot have more than 10 bits, including the sign bit. The sign bit is the most significant bit and all of the other bits are magnitude bits.
Step2
Study how BIN2DEC is evaluated. Each position represents a power of 2 beginning with 0 in the rightmost place and increasing by 1 for each place to the left. Thus, the first place gives the number of 1s, the second place is the number of 2s, the third place is the number of 4s and so on such that the nth place represents the value 2^n. 1101 is evaluated as 1x2^3 + 1x2^2 + 0x2^1 + 1x2^0 = 8 + 4 + 0 + 1 = 13.
Step3
Observe how this format allows negative numbers to be represented by two’s complement notation. A 1 in the 10th place indicates a negative number that can be evaluated as (value – 2^10). Thus, 1000001101 = 525 - 1024 = -499.
Step4
Expect BIN2DEC to return the #VALUE! error value if its argument is not a binary number or has more than 10 bits.
Step5
Look at an example of BIN2DEC. =BIN2DEC(1100100) returns 100. 2^6+2^5+2^2 = 64+32+4 = 100. =BIN2DEC(1111111111) returns -1 using two’s complement notation.

Post a Comment

POST A COMMENT

Request a New How-To Article

Looking for more How To information? Chances are there’s an eHow member who knows how to do what you’re looking to do. Submit an article request now!

eHow Article:  How to Use Excel's BIN2DEC Function

eHow Computers Editor

eHow Computers Editor

Category: Computers

Articles: See my other articles

Related Ads