Are hash tables in Excel possible?

  • Thread starter Mahurshi Akilla
  • Start date
M

Mahurshi Akilla

Is there a way to build/use hash tables in Excel ?

E.g.
My table contains

... 2.
.... ...
value_n 2.5
value_n+1 2.6
value_n_2 3.4
....
....

I am pretty sure the stuff on the left column occurs only once, but I
don't know what row value_n (or others for that matter) exist, and
their order changes every time I import my data from elsewhere.

Instead of using Control + F to find these and then find their values
(since I have a lot of these), I was wondering if there's a way to
build a hash table so I can use a formula like... $MYHASH{value_n} to
get either the value 2.6, or the row/col address so I can work
something out.

Can we do this?

Mahurshi Akilla
 
G

Guest

Fortunately your function already exists in Excel. It is call VLOOKUP:

Say in A1 thru B8 we have:

100 4.927273878
23 2.870022374
53 8.603009807
75 2.272587939
97 1.199421135
200 1.628241313
1 3.071201624
7 4.384416696

in another cell enter:
=VLOOKUP(75,A1:B8,2)
to display:
2.272587939


Please note that the data in cols A & B does not needed to be sorted.
 
G

Guest

Please note that the data in cols A & B does not needed to be sorted.

It does if you leave out the fourth argument for VLookup
=VLOOKUP(75,A1:B8,2,0)
 

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