Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Decimal to Hexadecimal

So, my company tracks items based on DEC and HEX, some with one, some with
the other. I'm tryign to create a formula that will convert items that have,
say DEC to HEX and vice versa. Problem is, when I attempt DECTOHEC and
HEXTODEC, it doesn't match what I get using my company's lookup tool (an
arduous process)

Here's what the company conversion are for a sample set of numbers:
DEC HEX
02313552326 17cecac6
02313552451 17cecb43
02313552469 17cecb55
02313552512 17cecb80
02313552538 17cecb9a
02313552779 17cecc8b
02313552798 17cecc9e
02313552829 17ceccbd
02313552891 17ceccfb
02313552900 17cecd04
05112837432 33C3E238

And Dec2Hex() gives me:
DEC HEX
02313552326 89E601C6
02313552451 89E60243
02313552469 89E60255
02313552512 89E60280
02313552538 89E6029A
02313552779 89E6038B
02313552798 89E6039E
02313552829 89E603BD
02313552891 89E603FB
02313552900 89E60404
05112837432 130BFB538

I'm missing something... :-/
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Decimal to Hexadecimal

Sean,

Your Co conversions look dodgy to me and the results Excel comes up with
can be verified here http://www.statman.info/conversions/hexadecimal.html.

Confused

"Sean Timmons" wrote:

So, my company tracks items based on DEC and HEX, some with one, some with
the other. I'm tryign to create a formula that will convert items that have,
say DEC to HEX and vice versa. Problem is, when I attempt DECTOHEC and
HEXTODEC, it doesn't match what I get using my company's lookup tool (an
arduous process)

Here's what the company conversion are for a sample set of numbers:
DEC HEX
02313552326 17cecac6
02313552451 17cecb43
02313552469 17cecb55
02313552512 17cecb80
02313552538 17cecb9a
02313552779 17cecc8b
02313552798 17cecc9e
02313552829 17ceccbd
02313552891 17ceccfb
02313552900 17cecd04
05112837432 33C3E238

And Dec2Hex() gives me:
DEC HEX
02313552326 89E601C6
02313552451 89E60243
02313552469 89E60255
02313552512 89E60280
02313552538 89E6029A
02313552779 89E6038B
02313552798 89E6039E
02313552829 89E603BD
02313552891 89E603FB
02313552900 89E60404
05112837432 130BFB538

I'm missing something... :-/

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 182
Default Decimal to Hexadecimal

Hello, Mike!
You wrote on Fri, 5 Jan 2007 12:40:02 -0800:

M Your Co conversions look dodgy to me and the results Excel
M comes up with can be verified here
http://www.statman.info/conversions/hexadecimal.html.

M Confused

M "Sean Timmons" wrote:

?? So, my company tracks items based on DEC and HEX, some
?? with one, some with the other. I'm tryign to create a
?? formula that will convert items that have, say DEC to HEX
?? and vice versa. Problem is, when I attempt DECTOHEC and
?? HEXTODEC, it doesn't match what I get using my company's
?? lookup tool (an arduous process)
??
?? Here's what the company conversion are for a sample set of
?? numbers: DEC HEX 02313552326 17cecac6
02313552451
?? 17cecb43 02313552469 17cecb55 02313552512 17cecb80
?? 02313552538 17cecb9a 02313552779 17cecc8b 02313552798
?? 17cecc9e 02313552829 17ceccbd 02313552891 17ceccfb
?? 02313552900 17cecd04 05112837432 33C3E238
??
?? And Dec2Hex() gives me:
?? DEC HEX
?? 02313552326 89E601C6
??
?? I'm missing something... :-/

The Excel values seem correct to me, two different calculators
and the Windows calculator!

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 418
Default Decimal to Hexadecimal

Sean Timmons wrote:
So, my company tracks items based on DEC and HEX, some with one, some with
the other. I'm tryign to create a formula that will convert items that have,
say DEC to HEX and vice versa. Problem is, when I attempt DECTOHEC and
HEXTODEC, it doesn't match what I get using my company's lookup tool (an
arduous process)
[....]
I'm missing something... :-/


Yes: the fact that your company uses a special algorithm to effect the
conversion, not a straigtht-forward conversion from decimal to hex,
like Excel does.

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


I might not be able to tell you the precise algorithm. But based on
the few examples given, the following Excel formulation yields the same
results:

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

where A1 is the decimal number. In other words, the right-most 8
digits are taken as a number and converted to hex, which is appended to
the remaining left-most digits taken as a number and converted to hex.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 947
Default Decimal to Hexadecimal

DEC HEX
02313552326 17cecac6


Hi. Your company breaks the Dec number into 2 parts.
23 & 13552326

23 is 17 hex
13552326 is cecac6 hex

--
HTH :)
Dana DeLouis
Windows XP & Office 2003


"Sean Timmons" wrote in message
...
So, my company tracks items based on DEC and HEX, some with one, some with
the other. I'm tryign to create a formula that will convert items that
have,
say DEC to HEX and vice versa. Problem is, when I attempt DECTOHEC and
HEXTODEC, it doesn't match what I get using my company's lookup tool (an
arduous process)

Here's what the company conversion are for a sample set of numbers:
DEC HEX
02313552326 17cecac6
02313552451 17cecb43
02313552469 17cecb55
02313552512 17cecb80
02313552538 17cecb9a
02313552779 17cecc8b
02313552798 17cecc9e
02313552829 17ceccbd
02313552891 17ceccfb
02313552900 17cecd04
05112837432 33C3E238

And Dec2Hex() gives me:
DEC HEX
02313552326 89E601C6
02313552451 89E60243
02313552469 89E60255
02313552512 89E60280
02313552538 89E6029A
02313552779 89E6038B
02313552798 89E6039E
02313552829 89E603BD
02313552891 89E603FB
02313552900 89E60404
05112837432 130BFB538

I'm missing something... :-/





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Decimal to Hexadecimal

Now, that was some good calculating! thank you su much for figuring that out!
It was driving me silly!

"Dana DeLouis" wrote:

DEC HEX
02313552326 17cecac6


Hi. Your company breaks the Dec number into 2 parts.
23 & 13552326

23 is 17 hex
13552326 is cecac6 hex

--
HTH :)
Dana DeLouis
Windows XP & Office 2003


"Sean Timmons" wrote in message
...
So, my company tracks items based on DEC and HEX, some with one, some with
the other. I'm tryign to create a formula that will convert items that
have,
say DEC to HEX and vice versa. Problem is, when I attempt DECTOHEC and
HEXTODEC, it doesn't match what I get using my company's lookup tool (an
arduous process)

Here's what the company conversion are for a sample set of numbers:
DEC HEX
02313552326 17cecac6
02313552451 17cecb43
02313552469 17cecb55
02313552512 17cecb80
02313552538 17cecb9a
02313552779 17cecc8b
02313552798 17cecc9e
02313552829 17ceccbd
02313552891 17ceccfb
02313552900 17cecd04
05112837432 33C3E238

And Dec2Hex() gives me:
DEC HEX
02313552326 89E601C6
02313552451 89E60243
02313552469 89E60255
02313552512 89E60280
02313552538 89E6029A
02313552779 89E6038B
02313552798 89E6039E
02313552829 89E603BD
02313552891 89E603FB
02313552900 89E60404
05112837432 130BFB538

I'm missing something... :-/




  #7   Report Post  
Posted to microsoft.public.excel.misc
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.

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
I want to convert a column of hexadecimal numbers to decimal num xs2sandeep Excel Discussion (Misc queries) 2 April 4th 06 09:46 AM
h:mm to decimal value Brent E Excel Discussion (Misc queries) 4 October 11th 05 07:09 PM
FIXED 2 DECIMAL PLACES, MUST ENTER ALL ZEROES AFTER DECIMAL POINT. SUKYKITTY Excel Discussion (Misc queries) 3 July 6th 05 01:50 PM
How do I override fixed decimal place settings in EXcel 2003? jroyv Excel Worksheet Functions 2 February 11th 05 06:07 PM
CONVERT HEXADECIMAL CELL TO DECIMAL NUMBER JAY Excel Worksheet Functions 4 January 25th 05 02:45 AM


All times are GMT +1. The time now is 03:24 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"