How can I convert an 8 character Hex word to binary for a lookup?

S

Seagondollar

I have a machine that spits out a string of 8 Hex characters that I need to
provide a lookup table to identify conditions. Since the positive limit of
Hex2bin is 1FF, I need to isolate one or 2 nibbles for translation.

E.G.: How can I pick out something like the FF in a string of 01a4FF92?
 
B

Biff

Hi!

Not a lot to go on ....

If "FF" is case sensitive:

=ISNUMBER(FIND("FF","01a4FF92"))

If not case sensitive:

=ISNUMBER(SEARCH("FF","01a4FF92"))

Of course, you mentioned using a lookup, maybe if you provide some more
detail a better solution could be offered.

Biff
 
S

Seagondollar

I've thought about this some more. In a string of eight Hex characters,
example:

0000xx00 (where xx = 00 to FF)

I need to do a lookup on those two (and only those two) characters to
identify conditions.

I know I could write this in C or something, but I'm trying to provide a
general Excel tool for our non-SW oriented brethren to be able to load
registers of multiple 8 character Hex strings to see the machine's state.
 
S

Seagondollar

I've thought about this some more. In a string of eight Hex characters,
example:

0000xx00 (where xx = 00 to FF)

I need to do a lookup on those two (and only those two) characters to
identify conditions.

I know I could write this in C or something, but I'm trying to provide a
general Excel tool for our non-SW oriented brethren to be able to load
registers of multiple 8 character Hex strings to see the machine's state.
 
B

Biff

Hi!

Ok, so what do you need to lookup?

In Excel a hex string is evaluated as a text string because it contains both
alpha and numeric chars. You can of course convert that string to a numeric
value by using one of the Hex2 functions.

So, if you have hex strings of 8 chars and only need to do a lookup based on
the 5th and 6th char positions:

A1 = 01a4FF92

Then a lookup formula could be something like this:

=VLOOKUP(MID(A1,5,2),H1:I5,2,0)

Performs a lookup of "FF" in the table located in the range H1:I5 and
returns the corresponding value from column 2 of that table.

Biff
 
S

Seagondollar

I'll give that a try. Sounds like it's what I need.

Now if we can get Microsoft to remove the previous replies rather than us
having to keep this from getting exponentially long (Or would that be
geometrically? I don't know. Still waiting for the caffiene to kick in.)

Thanx
 

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