Excel User Group
Microsoft Excel blogs, forums, files. Read, ask questions, provide answers.

Format help

Latest post Thu, Apr 3 2008 8:18 AM by tony. 2 replies.
  • Thu, Apr 3 2008 3:29 AM

    • tony
    • Top 150 Contributor
    • Joined on Thu, Apr 3 2008
    • Posts 2
    • Points 26

    Crying [:'(] Format help

    1) In cell A1 I have "1" and cell A2 has "2" (thesa are Decimal values).

    2) In cell B1 I have "=dec2bin(A1)" and in cell B2 I have "=ec2bin(A2)"

    3) Cell B1 is displayed as "1" and cell B2 is diplayed as "10" (these ar binary values).

    How can I make cell B1 display as "0001" and cell B2 display as "0010" (4 bit binary)?

     

    Thanks for all your help.

    • Post Points: 21
  • Thu, Apr 3 2008 4:06 AM In reply to

    • Nick Hodge
    • Top 10 Contributor
    • Joined on Sun, Dec 23 2007
    • Southampton
    • Posts 336
    • Points 5,771
    • MVP

    Tony

    May not help as they will become text representations of the numbers so not used in any onward calculations but

    =TEXT(DEC2BIN(A1),"0000")

    Will do it

    Regards
    Nick Hodge
    Microsoft MVP, Excel
    Southampton, UK

    • Post Points: 21
  • Thu, Apr 3 2008 8:18 AM In reply to

    • tony
    • Top 150 Contributor
    • Joined on Thu, Apr 3 2008
    • Posts 2
    • Points 26

    Thanks Nick, it did the trick.

    TonySmile

    • Post Points: 5
Page 1 of 1 (3 items) | RSS
Copyright Excel User Group and the relevant contributors, 2008. All Trade Marks acknowledged. This site is a peer-to-peer site and NOT affiliated in any way to Microsoft Corp. All rights reserved.