Vlookup

E

Equaliser

If I enter York in cell E2 I want Vlookup to be
=VLOOKUP(E2,York,2).
But if I enter Hereford in cell E2 the Vlookup formula must be
=VLOOKUP(E2,Hereford,2).
So, I need this part of the formula to change depending on what is in cell
E2. If there were only two variations I would use a nested formula? But I
have around 25 possibilities that I need to look up. Is there an easier way?
 
P

pdberger

Equaliser --

The first cell of the VLOOKUP formula is the info you want to look up Inside
the lookup array. So you might set up cell E1 as the info you want to look
up, and cell E2 as the name of the array. Here are the steps:

1) Name the ranges for the lookup tables. Select them, then
Insert>Name>Define to give them the names (like 'York' and 'Hereford').
2) Your formula would be
=VLOOKUP(E1,INDIRECT(E2),2)

Worked ok for me.

HTH
 

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