MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Using Variables in Vlookups.

Posted by Lael Buchanan on December 11, 1999 10:14 AM


Got a good one for anyone that can help. I have a Vlookup that I need to do where the table that it is looking on varies depending on another variable. So my lookup loks something like this:

Vlookup($C$8,(Variable Table),2)

I've tried to use a nested Vlookup to find the right table, but that didn't seem to work as all I got was a #Value error. Can anyone give me any information on hwo to get a variable to work withing a vlookup?

Thanks in advance,

Lael Buchanan

Posted by Marcus Macrae on December 13, 1999 7:45 AM


Use the INDIRECT function:
will look in Table1 if Variable_Table is "Table1", etc.

- Marcus

Posted by Lael Buchanan on December 13, 1999 9:04 AM

That worked perfectly. Thank you for the help.