### Conversion of hexadecimal numbers to binary in excel and the implementation of shift operations in binary.

Excel can use the formula to convert hexadecimal numbers to binary.

Software version: Office2007

Methods are as follows:

1. Convert the hexadecimal number in column A to binary:

2. Enter the formula is as follows:

3. Pull down the fill to get the result:

.

### How to convert hexadecimal to binary?

1. Binary 1000 exclusively into hexadecimal with 8421 conversion method, that is, from left to right, 8 * 1 + 4 * 0 + 2 * 0 + 1 * 0 = 0x8, this is the universal conversion of all hexadecimal to binary conversion, bit-for-bit aligned conversion, respectively, multiplied by 8421, and then add up. If the binary number is not enough bits, should be in the integer bits to the left or decimal places to the right with 0 to make up a multiple of 4. Of course, the integer part and the decimal part should be converted separately. Such as: 111100 will be converted to hexadecimal, with 8421 conversion method, but can only be aligned to the lower four bits of the binary, the higher two can not be aligned to make up for the 0 to 00111100B, and then use 8421: 0*8 + 0*4 + 1*2 + 1*1 + 1*8 + 4*1 + 0*2 + 0*1 = 0x3C. Note: the hexadecimal number is equivalent to the binary number of one bit of the four bits! .

2. Hexadecimal conversion binary: 8421 patchwork method, the first thing to be clear is: four binary digits represent a hexadecimal, according to the above example, the conversion of 0x3C. the first conversion of the binary of the higher four, that is, the number of hexadecimal 3, you can add the 8421 patchwork of the four digits, if it can be derived from the 3, will be set to 1, the rest of the 0. These four numbers, only 2 + 1 to get 3, therefore, converted to binary is 0011. the lower four bits, hexadecimal number C (decimal number 12), only 8 + 4 = 12, set to 1, the rest to 0, you get 1100, high and low bits combined, the binary number for 00111100.

Combined with your example of converting 0x8, 8421 in only 8 with its

With your example, to convert 0x8, only 8 of 8421 matches, directly set the bit to 1, the rest to 0, to get 1000B.

There is also a simpler way, the owner can directly query the BCD code, any one of the hexadecimal number can be converted by querying the BCD code.

Additionally, the number converted by the friend upstairs is not hexadecimal, but decimal.

### Excel how to use the hexadecimal conversion binary function HEX2BIN

Formula: = HEX2BIN (A2), that is, the hexadecimal number in cell A2 will be converted to binary

Formula: = HEX2BIN (“E4”) that is, the hexadecimal data of the E4 will be converted to binary, the result is: 11100100