Converting Decimal to Binary

R

Russ

Anyone know how to convert decimal numbers >= 512 to
binary in Excel? DEC2BIN apparently only work for numbers
up to 511.

Thanks!
 
H

Harlan Grove

Anyone know how to convert decimal numbers >= 512 to
binary in Excel? DEC2BIN apparently only work for numbers
up to 511.

Pick your number apart into powers of 512. For numbers from 0 to -1+2^36,

=DEC2BIN(INT(x/2^27),9)&DEC2BIN(INT(MOD(x,2^27)/2^18),9)
&DEC2BIN(INT(MOD(x,2^18)/2^9),9)&DEC2BIN(MOD(x,2^9),9)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top