Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How can I convert an 8 character Hex word to binary for a lookup?
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? |
#2
|
|||
|
|||
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 "Seagondollar" wrote in message ... 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? |
#3
|
|||
|
|||
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. "Biff" wrote: 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 "Seagondollar" wrote in message ... 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? |
#4
|
|||
|
|||
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. "Biff" wrote: 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 "Seagondollar" wrote in message ... 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? |
#5
|
|||
|
|||
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 "Seagondollar" wrote in message ... 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. "Biff" wrote: 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 "Seagondollar" wrote in message ... 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? |
#6
|
|||
|
|||
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 "Biff" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
convert value in word. For Exampe Rs.115.00 convert into word as . | Excel Discussion (Misc queries) | |||
in mail merge how do i convert currency from excel to word | Excel Discussion (Misc queries) | |||
convert character to value at relative cell | Excel Worksheet Functions | |||
How to convert Word table with paragraphing to Excel? | Excel Discussion (Misc queries) | |||
How to convert the table in word to excel sheet? | Excel Discussion (Misc queries) |