Convert text to hex

D

Don

Hi All,

A seemingly simple but none the less frustrating one...


The task:

Split up a string of chars into columns - easy MID(,,)

Convert text one of the resultant columns into hex data which can then be
converted to decimal - easy NOT ( apparently )

The hex to decimal bit is easy but I can't find out how to convert the hex "text
string" to a hex "number" to feed to HEX2DEC.

This was to be a two second job & now hours of scouring the net have produced
nada. Any help greatly appreciated.

Cheers

Don
 
D

Don

In the great tradition of looking for hours only to work out the the answer 10
secs after the send button is pressed...

The problem is the size of the hex number. ie. 2^14. We will do a further split
prior to the convert.

Any simple way of telling Excel to convert as unsigned?

Cheers

Don
 
N

Niek Otten

You don't have to. From Help:
=HEX2DEC("A5") Converts hexadecimal A5 to decimal (165)
 
D

Don

Found it... At risk of stating the now obvious ;-)


ColA - <23:14:18> 24000FD1 - The input string from the uart
ColC - =MID(A1,11,10) - pick out the variable length hex string

- the hex string isn't a fixed length & mid must attach nulls or spaces to it

ColD - =HEX2DEC(C1)

And so the number conversion barfs


Changed to ...

ColC - =TRIM(MID(A1,11,15))
ColD - =HEX2DEC(C1)

Happy campers!

Cheers

Don


Niek said:
You don't have to. From Help:
=HEX2DEC("A5") Converts hexadecimal A5 to decimal (165)

In the great tradition of looking for hours only to work out the the answer 10
secs after the send button is pressed...

The problem is the size of the hex number. ie. 214. We will do a further split
prior to the convert.

Any simple way of telling Excel to convert as unsigned?

Cheers

Don
Hi All,

A seemingly simple but none the less frustrating one...


The task:

Split up a string of chars into columns - easy MID(,,)

Convert text one of the resultant columns into hex data which can then be
converted to decimal - easy NOT ( apparently )
The hex to decimal bit is easy but I can't find out how to convert the hex
"text string" to a hex "number" to feed to HEX2DEC.
This was to be a two second job & now hours of scouring the net have produced
nada. Any help greatly appreciated.
 

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