View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Hexidecimal lookup

On 21 Jul 2006 14:58:40 -0700, "Harlan Grove" wrote:

Stuart Peters wrote...
I know there is a way to do this I just can't figure it out.


Why? Spreadsheets aren't meant to work with hexadecimal numerals.
Trying to make them do so is a LOT of work.

Below is the lookup table.
I would like to enter a Hexidecimal number and have the program return all
the Fault descriptions that are applicable.
For instance If I enter the Hex value '2C'
I should get the following list:
General Fault Indicator
Temperature Indicator
Power Supply Indicator

Note: Fault value in column A in Hex

...

Hexadecimal 'numbers' are always text, so they need to have leading
zeros in order for, say, "9" as "00009" to be less than "10000".

Assuming your table with column headings is in A1:B21, with fault code
entered in cell G3 and first fault description in cell H3, *and* with
the Analysis ToolPak loaded so that you can use HEX2DEC and DEC2HEX,
try these formulas.

H3:
=LOOKUP(RIGHT("00000"&G3,5),RIGHT("00000"&$A$2:$A $21,5),$B$2:$B$21)

H4:
=IF(IF(H3<"",MOD(HEX2DEC($G$3),HEX2DEC(INDEX($A$ 2:$A$21,MATCH(H3,
$B$2:$B$21,0))))),LOOKUP(DEC2HEX(MOD(HEX2DEC($G$3 ),
HEX2DEC(INDEX($A$2:$A$21,MATCH(H3,$B$2:$B$21,0))) ),5),
RIGHT("00000"&$A$2:$A$21,5),$B$2:$B$21),"")

Fill H4 down into H5:H22 to cover fault code entry of FFFFF.



Maybe Fill Right?
--ron