Answered by:
Decimal to binary number conversion

Not being very good at math, I have reviewed the topics relative to Decimal to Binary conversion and, quite frankly, I'm having trouble understanding them.
Plain and simple, what I need to do is to convert a decimal number to it's binary equivalent. (Enter a decimal number in a text box and return that number with it's binary equivalent).
I've tried and failed to understand the conversion examples given and am unable to get the Dec2Bin function in Excel to work.
Is there a simple, straightforward way of doing this, that even a numbnut can understand?
Thanks.
JEB
JEBMHS
Question
Answers

hi,
the calculation of conversion is, for example:
=Dec2Bin(255)
=11111111
=(2^7)+(2^6)+(2^5)+(2^4)+(2^3)+(2^2)+(2^1)+(2^0)
=255another
=Dec2Bin(129)
=10000001
=(2^7)+(2^0)
=129^ = exponent
isabelle
Le 20110331 11:45, JEBMHS a écrit :
Not being very good at math, I have reviewed the topics relative to Decimal to Binary conversion and, quite frankly, I'm having trouble understanding them.
Plain and simple, what I need to do is to convert a decimal number to it's binary equivalent. (Enter a decimal number in a text box and return that number with it's binary equivalent).
I've tried and failed to understand the conversion examples given and am unable to get the Dec2Bin function in Excel to work.
Is there a simple, straightforward way of doing this, that even a numbnut can understand?
Thanks.
JEB
 Marked as answer by Bruce Song Tuesday, April 12, 2011 9:38 AM

With a decimal value in A1, try:
=DEC2BIN(INT(A1/2^27),9)&DEC2BIN(INT(MOD(A1,2^27)/2^18),9)&DEC2BIN(INT(MOD(A1,2^18)/2^9),9)&DEC2BIN(MOD(A1,2^9),9)
From:
gsnu201103 Marked as answer by Bruce Song Tuesday, April 12, 2011 9:37 AM
All replies

Hi
The DEC2BIN function simply converts a decimal to binary.
So if A1 contains the number 6 =DEC2BIN(A1) would give you 110. If A1 = 7 then it would give 111. There is an optional part to the formula which controls the number of characters in the answer so =DEC2BIN(A1,4) would give 0111 with 7 in A1.
Hope this helps
G North MMI 
hi,
the calculation of conversion is, for example:
=Dec2Bin(255)
=11111111
=(2^7)+(2^6)+(2^5)+(2^4)+(2^3)+(2^2)+(2^1)+(2^0)
=255another
=Dec2Bin(129)
=10000001
=(2^7)+(2^0)
=129^ = exponent
isabelle
Le 20110331 11:45, JEBMHS a écrit :
Not being very good at math, I have reviewed the topics relative to Decimal to Binary conversion and, quite frankly, I'm having trouble understanding them.
Plain and simple, what I need to do is to convert a decimal number to it's binary equivalent. (Enter a decimal number in a text box and return that number with it's binary equivalent).
I've tried and failed to understand the conversion examples given and am unable to get the Dec2Bin function in Excel to work.
Is there a simple, straightforward way of doing this, that even a numbnut can understand?
Thanks.
JEB
 Marked as answer by Bruce Song Tuesday, April 12, 2011 9:38 AM



hi,
it's the maximum, but there is another solution
http://cjoint.com/?2dFvvyerrqS
isabelle
Le 20110331 14:54, JEBMHS a écrit :
Thank you very much. It does work up to a point. What happens when the value excees 512? Even with the optional part it doesn't compute
JEB

With a decimal value in A1, try:
=DEC2BIN(INT(A1/2^27),9)&DEC2BIN(INT(MOD(A1,2^27)/2^18),9)&DEC2BIN(INT(MOD(A1,2^18)/2^9),9)&DEC2BIN(MOD(A1,2^9),9)
From:
gsnu201103 Marked as answer by Bruce Song Tuesday, April 12, 2011 9:37 AM

very top !
thank alot Gary's and Ron
isabelleLe 20110331 16:36, Gary's Student [MVP] a écrit :
With a decimal value in A1, try:
=DEC2BIN(INT(A1/2^27),9)&DEC2BIN(INT(MOD(A1,2^27)/2^18),9)&DEC2BIN(INT(MOD(A1,2^18)/2^9),9)&DEC2BIN(MOD(A1,2^9),9)
From:
http://groups.google.com/group/microsoft.public.excel.worksheet.functions/browse_thread/thread/30bcf0c7126c30c1/c60367201a741784?lnk=gst&q=%22decimal+to+binary%22#c60367201a741784<http://groups.google.com/group/microsoft.public.excel.worksheet.functions/browse_thread/thread/30bcf0c7126c30c1/c60367201a741784?lnk=gst&q=%22decimal+to+binary%22#c60367201a741784>
