View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
[email protected] joeu2004@hotmail.com is offline
external usenet poster
 
Posts: 418
Default Decimal to Hexadecimal

PS....

I wrote:
Sean Timmons wrote:
Here's what the company conversion are for a sample set of numbers:
DEC HEX
02313552326 17cecac6
[....]
05112837432 33C3E238

[....]
=DEC2HEX(LEFT(A1,LEN(A1)-8)) & DEC2HEX(RIGHT(A1,8))


That works fine when the right-most 8 digits form the number 001048576
or higher. That always yields 6 hex digits. It is unclear what your
company's algorithm would do with "numbers" less than 001048576. If
they zero-fill to 6 hex digits, as I suspect, use:

=DEC2HEX(LEFT(A1,LEN(A1)-8)) & DEC2HEX(RIGHT(A1,8),6)

Also note that the formula assumes the entire decimal number (A1) is at
least 9 digits.