Hash table lookup

  • Thread starter Thread starter JAscII
  • Start date Start date
J

JAscII

I have an excel sheet with columns similar to what you could call a
hash table. In another sheet, i have a column that contains references
to the keys of the table. I would like the column next to that one to
fetch the values from the table according to the key it is preceded.
How do I proceed? thanks
 
Not familiar with the term "hash table".

Possibly use the VLOOKUP function?

See help on VLOOKUP.

=VLOOKUP(A1,Sheet2!hashtable,2,FALSE) might get you started.

Entered in Sheet1 B1 and copied down column B. Assumes hashtable is a named
range on Sheet2.

Sheet1 Column A has the key numbers entered.

Key numbers in the hash table are in column 1

Gord Dibben Excel MVP
 
Don said:
Was wondering what a hash table was myself....:)

Maybe it's a mystery.

Then again, maybe it's something that could be found using a Google web
search (a mere quarter million hits).

It's a data structure ill-suited to spreadsheets. It involves using an
encoding function to convert arbitrary strings into numbers and using those
numbers to find the corresponding strings. Since many different strings
could map into the same hash key, the hash key is usually a pointer to the
head of a linked list in which each string and associated values are stored.

The Windows Script Scripting.Dictionary object is a good example of a data
object using a hash table. Descriptions of the awk programming language's
associative arrays also describe the underlying hash table data structure
and access procedures.
 
Back
Top