I have a two-column lookup table something like:
Col1 Col2 tran1 =qty/1000 tran2 =qty/2000 tran3 =price+10where
qty
and price
are named ranges.
I want to use Vlookup
(or whatever else may work) to populate a cell with the formula in column 2, rather than the value.
Let's suppose A1 contains tran1
and B1 = 2500. B1 is the named range qty
. I want to lookup the formula in Col2 of my lookup table and insert the formula into cell C1, so that cell C1 displays 2.5.
Using Excel 2010.
I'm struggling to find a way to do this.
Say we have a lookup table in columns G and H like:
We want to enter a word in cell A1 and the appropriate formula appear in cell B1.
Enter the following Event macro in the worksheet code area:
Because it is worksheet code, it is very easy to install and automatic to use:
If you have any concerns, first try it on a trial worksheet.
If you save the workbook, the macro will be saved with it. If you are using a version of Excel later then 2003, you must save the file as .xlsm rather than .xlsx
To remove the macro:
To learn more about macros in general, see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
and
http://msdn.microsoft.com/en-us/library/ee814735(v=office.14).aspx
To learn more about Event Macros (worksheet code), see:
http://www.mvps.org/dmcritchie/excel/event.htm
Macros must be enabled for this to work!