EXCEL HEX2DEC conversion error

G

Guest

I read a file of hex numbers into Excel. I then paste the function HEX2DEC
into
coulumn C. I select column A (where the file of hex numbers were entered) as
the
numbers to convert. The vast majority of the numbers are converted correctly,
however hex numbers such as 34e3 are converted as if they are in sciencetic
notation. example
1.00E+08 4294967296 WRONG should be 1e08 = 7688
1.00E+08 4294967296
00000010d8 4312 right
1.10E+07 285212672
2.00E+18 #NUM!
2.00E+10 #NUM!
2.00E+46 #NUM!
2.00E+46 #NUM!

and I have seen 5dec be converted as a date!

What am I doing wrong? How do I tell Excel that column A is strictly hex
numbers?
 
G

Guest

I should have added that the file of hex numbers are not in sciencetific
notation.
hmmm......means its the routine that reads the file into column A and not the
HEX2DEC conversion routine.
 
R

Ron Rosenfeld

I read a file of hex numbers into Excel. I then paste the function HEX2DEC
into
coulumn C. I select column A (where the file of hex numbers were entered) as
the
numbers to convert. The vast majority of the numbers are converted correctly,
however hex numbers such as 34e3 are converted as if they are in sciencetic
notation. example
1.00E+08 4294967296 WRONG should be 1e08 = 7688
1.00E+08 4294967296
00000010d8 4312 right
1.10E+07 285212672
2.00E+18 #NUM!
2.00E+10 #NUM!
2.00E+46 #NUM!
2.00E+46 #NUM!

and I have seen 5dec be converted as a date!

What am I doing wrong? How do I tell Excel that column A is strictly hex
numbers?

You don't specify what you mean by "read a file of hex numbers into Excel"

There are a variety of ways of doing this.

For what you are doing, you need to "read" it in as TEXT.

If you are opening a .txt file, this should bring up the data/text to columns
wizard which has an option for importing the data as text.

If you are opening a .csv file, you can rename it to a .txt file before opening
it.

If you are copying the data and then pasting it into Excel, try formatting the
target as TEXT prior to pasting in the data.

Post back with more information.


--ron
 
G

Guest

The file is named whatever.hex.
I found that if I read it in as a text file, a few menus down in the OPEN file
dialog box then all is well.
Its a file of hex numbers I capture off a logic analyzer. Not having used
Excel
I'm a bit in the dark. I'll try renaming it as whatever.txt and see what
happens.

Thanks for the response.
 
R

Ron Rosenfeld

The file is named whatever.hex.
I found that if I read it in as a text file, a few menus down in the OPEN file
dialog box then all is well.
Its a file of hex numbers I capture off a logic analyzer. Not having used
Excel
I'm a bit in the dark. I'll try renaming it as whatever.txt and see what
happens.

That "should" work; especially if there are no extraneous characters in the
file.

Excel has this sometimes annoying habit of trying to be helpful by translating
things that look like numbers (even in scientific notation) into numbers; and
things that look like dates, into dates. The only way I know of to circumvent
that behavior is to convince Excel to treat the data as text.

There are several ways of doing this -- we should be able to find a way that
works for your.


--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top