none
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

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)
    =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 Bruce Song 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:

    http://groups.google.com/group/microsoft.public.excel.worksheet.functions/browse_thread/thread/30bcf0c7126c30c1/c60367201a741784?lnk=gst&q=%22decimal+to+binary%22#c60367201a741784

     

     


    gsnu201103
    • Marked as answer by Bruce Song Tuesday, April 12, 2011 9:37 AM
    Thursday, March 31, 2011 8:36 PM
    Moderator

All replies