# Decimal to binary number conversion

### Question

• 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

JEB-MHS
Thursday, March 31, 2011 3:45 PM

• 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)
=255

another

=Dec2Bin(129)
=10000001
=(2^7)+(2^0)
=129

^   =   exponent

isabelle

Le 2011-03-31 11:45, JEB-MHS 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 Tuesday, April 12, 2011 9:38 AM
Thursday, March 31, 2011 5:34 PM
• 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 Tuesday, April 12, 2011 9:37 AM
Thursday, March 31, 2011 8:36 PM

### 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
Thursday, March 31, 2011 4:09 PM
• 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)
=255

another

=Dec2Bin(129)
=10000001
=(2^7)+(2^0)
=129

^   =   exponent

isabelle

Le 2011-03-31 11:45, JEB-MHS 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 Tuesday, April 12, 2011 9:38 AM
Thursday, March 31, 2011 5:34 PM
• 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

JEB-MHS
Thursday, March 31, 2011 6:54 PM
• 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

JEB-MHS
Thursday, March 31, 2011 6:54 PM
• hi,

it's the maximum, but there is another solution

http://cjoint.com/?2dFvvyerrqS

isabelle

Le 2011-03-31 14:54, JEB-MHS 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

Thursday, March 31, 2011 7:26 PM
• 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 Tuesday, April 12, 2011 9:37 AM
Thursday, March 31, 2011 8:36 PM
• very top !
thank alot  Gary's and Ron
isabelle

Le 2011-03-31 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: