+ Reply to Thread
Results 1 to 9 of 9

Convert Binary to Hex

  1. #1
    Chipmunk
    Guest

    Convert Binary to Hex

    How to I convert a 32 bit binary number to hex?

  2. #2
    Barb Reinhardt
    Guest

    RE: Convert Binary to Hex

    Have you tried function BIN2HEX?

    "Chipmunk" wrote:

    > How to I convert a 32 bit binary number to hex?


  3. #3
    Chipmunk
    Guest

    RE: Convert Binary to Hex

    Yes. I can do it with 8 digits and some others but i need to convert a 12
    digit binary number to hex. example: cell f11 has: 010101010101 what i
    have is =bin2hex(F11) and it doesn work.

    "Barb Reinhardt" wrote:

    > Have you tried function BIN2HEX?
    >
    > "Chipmunk" wrote:
    >
    > > How to I convert a 32 bit binary number to hex?


  4. #4
    Tom Ogilvy
    Guest

    RE: Convert Binary to Hex

    =BIN2HEX(LEFT(B4,8))&BIN2HEX(RIGHT(B4,4))

    --
    regards,
    Tom Ogilvy


    "Chipmunk" wrote:

    > Yes. I can do it with 8 digits and some others but i need to convert a 12
    > digit binary number to hex. example: cell f11 has: 010101010101 what i
    > have is =bin2hex(F11) and it doesn work.
    >
    > "Barb Reinhardt" wrote:
    >
    > > Have you tried function BIN2HEX?
    > >
    > > "Chipmunk" wrote:
    > >
    > > > How to I convert a 32 bit binary number to hex?


  5. #5
    Chipmunk
    Guest

    RE: Convert Binary to Hex

    Wonderful that works great. Now the long pass.... Can we do it with a 32
    bit binary number?

    Thanks.

    "Tom Ogilvy" wrote:

    > =BIN2HEX(LEFT(B4,8))&BIN2HEX(RIGHT(B4,4))
    >
    > --
    > regards,
    > Tom Ogilvy
    >
    >
    > "Chipmunk" wrote:
    >
    > > Yes. I can do it with 8 digits and some others but i need to convert a 12
    > > digit binary number to hex. example: cell f11 has: 010101010101 what i
    > > have is =bin2hex(F11) and it doesn work.
    > >
    > > "Barb Reinhardt" wrote:
    > >
    > > > Have you tried function BIN2HEX?
    > > >
    > > > "Chipmunk" wrote:
    > > >
    > > > > How to I convert a 32 bit binary number to hex?


  6. #6
    Michel Pierron
    Guest

    Re: Convert Binary to Hex

    Hi Chipmunk,

    Function BinToHex(Binary As String)
    Dim Value&, i&, Base#: Base = 1
    For i = Len(Binary) To 1 Step -1
    Value = Value + IIf(Mid(Binary, i, 1) = "1", Base, 0)
    Base = Base * 2
    Next i
    BinToHex = Hex(Value)
    End Function

    MP

    "Chipmunk" <[email protected]> a écrit dans le message de
    news: [email protected]...
    > How to I convert a 32 bit binary number to hex?




  7. #7
    Chipmunk
    Guest

    Re: Convert Binary to Hex

    Thanks for the response. I opened up the vb editor and pasted in your code.
    What do I need to put in the worksheet cell?

    Thanks.

    "Michel Pierron" wrote:

    > Hi Chipmunk,
    >
    > Function BinToHex(Binary As String)
    > Dim Value&, i&, Base#: Base = 1
    > For i = Len(Binary) To 1 Step -1
    > Value = Value + IIf(Mid(Binary, i, 1) = "1", Base, 0)
    > Base = Base * 2
    > Next i
    > BinToHex = Hex(Value)
    > End Function
    >
    > MP
    >
    > "Chipmunk" <[email protected]> a écrit dans le message de
    > news: [email protected]...
    > > How to I convert a 32 bit binary number to hex?

    >
    >
    >


  8. #8
    Michel Pierron
    Guest

    Re: Convert Binary to Hex

    Hi Chipmunk,
    This code must be in a standard module.
    In worksheet cell:
    =
    In ComboBox Functions: select Other functions
    In ComboBox Categories: Select Personalized
    In ListBox Functions: Select BinToHex

    Regards,
    MP

    "Chipmunk" <[email protected]> a écrit dans le message de
    news: [email protected]...
    > Thanks for the response. I opened up the vb editor and pasted in your
    > code.
    > What do I need to put in the worksheet cell?
    >
    > Thanks.
    >
    > "Michel Pierron" wrote:
    >
    >> Hi Chipmunk,
    >>
    >> Function BinToHex(Binary As String)
    >> Dim Value&, i&, Base#: Base = 1
    >> For i = Len(Binary) To 1 Step -1
    >> Value = Value + IIf(Mid(Binary, i, 1) = "1", Base, 0)
    >> Base = Base * 2
    >> Next i
    >> BinToHex = Hex(Value)
    >> End Function
    >>
    >> MP
    >>
    >> "Chipmunk" <[email protected]> a écrit dans le message
    >> de
    >> news: [email protected]...
    >> > How to I convert a 32 bit binary number to hex?

    >>
    >>
    >>




  9. #9
    Registered User
    Join Date
    12-30-2009
    Location
    miami
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Convert Binary to Hex

    I use this online binary to hex converter to make sure I convert the right way
    Pretty cool!
    David

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1