Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

large binary numbers

934 views
Skip to first unread message

Himu

unread,
Jul 21, 2005, 10:16:09 PM7/21/05
to
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?

Barb Reinhardt

unread,
Jul 22, 2005, 9:09:54 AM7/22/05
to
Will the DEC2BIN function get you what you want?

"Himu" <Hi...@discussions.microsoft.com> wrote in message
news:E40F29E6-4C74-438F...@microsoft.com...

Himu

unread,
Jul 22, 2005, 10:52:05 AM7/22/05
to
no, for large numbers DEC2BIN functions dont work. Any other suggestions?

MrShorty

unread,
Jul 22, 2005, 1:20:41 PM7/22/05
to

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.


--
MrShorty
------------------------------------------------------------------------
MrShorty's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=22181
View this thread: http://www.excelforum.com/showthread.php?threadid=389266

Jerry W. Lewis

unread,
Jul 26, 2005, 9:53:15 PM7/26/05
to
Himu wrote:

> 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

0 new messages