large binary numbers

G

Guest

i want a column which will contain numbers from 0~65536. Then I want to
convert them into 16 bit binary numbers. How do I do this?
 
M

MrShorty

A Google search for "algorithm for converting decimal to binary" yielded
several pages with descriptions of a couple of generic algorithms for
converting decimal numbers to binary numbers. I'm sure those
algorithms could be adapted to a spreadsheet or VBA procedure.
 
J

Jerry W. Lewis

Himu said:
no, for large numbers DEC2BIN functions dont work. Any other suggestions?

Sure it does, you just have to work a little harder.

=DEC2BIN(INT(n/256),8)&DEC2BIN(MOD(n,256),8)

However, 65536 = 2^16, so you need 17 bits to represent it, as in

=DEC2BIN(INT(n/256),9)&DEC2BIN(MOD(n,256),8)

Jerry
 

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