By using the DEC2HEX with the character count to 10, the number of bits can be increased up to 40. The minimum number is -549755813888 (HEX 8000000000)and the maximum number is 549755813887 (HEX 7FFFFFFFFF). Each pair of HEX characters represents a bit array of 8. Use the formulas below:
For the following formulas, the number is entered into A1
An 8 BIT array requires only the last 2 characters to be used.
=HEX2BIN(RIGHT(DEC2HEX(A1,10),2),8)
A 16 BIT array simply uses the MID formula for the next 2 HEX characters starting at location 7.
=HEX2BIN(MID(DEC2HEX(A1,10),7,2),8)&HEX2BIN(RIGHT(DEC2HEX(A1,10),2),8)
Add another 8 bits to the array by simply adding to the left of the formula with the starting point 2 less than the previous.
=HEX2BIN(MID(DEC2HEX(A1,10),5,2),8)&HEX2BIN(MID(DEC2HEX(A1,10),7,2),8)&HEX2BIN(RIGHT(DEC2HEX(A1,10),2),8)
and so on.
Cheers!
Bookmarks