Hi,
I have the following formula which works fine in this form:
where GradingMatrix1 is a Named range.Code:=vlookup(H2,GradingMatrix1,2)
I have other named ranges GradingMatrix2, GradingMatrix3 that I would like to pass to the formula depending on user input.
If a cell, say A2, contains a value "GradingMatrix1" and I convert the formula as follows:
then (unsurprisingly) the formula considers the array argument to be the single cell A2, and not the named range referred to in the cell contents.Code:=vlookup(H2,A2,2)
Maybe somebody out there could suggest a method of passing the range named within the cell as an argument to the formula?
Many thanks
B.
Last edited by Orson100; 10-21-2009 at 10:42 AM.
Try
=vlookup(H2,Indirect("GradingMatrix"&A2),2)
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
NBVC beat me to it... and his method is obviously better than mine..
I was going along the lines of:
=IF(A2=GradingMatrix1,VLOOKUP(H2,GradingMatrix1,2)),IF(A2=GradingMatrix2,VLOOKUP(H2,GradingMatrix2,2 )),IF(A2=GradingMatrix3,VLOOKUP(H2,GradingMatrix3,2),"")
Great thanks NBVC, perfect solution and thanks for tip on parsing the named range ref!!
Orson.
Last edited by NBVC; 10-20-2009 at 11:00 AM. Reason: corrected spelling of my name
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks