Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Convert Binary to Hex

How to I convert a 32 bit binary number to hex?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Convert Binary to Hex

Have you tried function BIN2HEX?

"Chipmunk" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default 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" a écrit dans le message de
news: ...
How to I convert a 32 bit binary number to hex?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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" a écrit dans le message de
news: ...
How to I convert a 32 bit binary number to hex?




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default 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" a écrit dans le message de
news: ...
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" a écrit dans le message
de
news:
...
How to I convert a 32 bit binary number to hex?






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Convert Binary to Hex

Michel,
I sincerly appreciate all your help. But....I'm must be green here. I'm
not getting what your saying to do 100 percent. Can explain so that I might
better understand.

Thanks,
Benny

"Michel Pierron" wrote:

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" a écrit dans le message de
news: ...
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" a écrit dans le message
de
news:
...
How to I convert a 32 bit binary number to hex?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert to Binary and Break out results DCLittlejohn Excel Worksheet Functions 10 August 28th 08 01:23 AM
convert binary to decimal Krishnakanth Excel Discussion (Misc queries) 2 May 7th 08 02:56 PM
Convert Binary to Decimal using IF and Sum Functions? YourFriendlyTechGuy Excel Worksheet Functions 3 January 31st 07 01:06 AM
Convert SpreadsheetML to binary .xls [email protected] Excel Programming 0 March 17th 06 05:45 PM
How do I convert cell contents that are Hex to binary? KarenSue33 Excel Worksheet Functions 1 February 21st 05 05:41 PM


All times are GMT +1. The time now is 06:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"