I'm building a pricing calculator that depends on selections from a list box, one of which I'd like to use in a lookup function (e.g. vlookup as the table_array argument) but I get #value error when I reference the cell containing the listbox. I've tried naming the range and naming a table as well as all lookup and reference functions to no avail. I'm pretty sure I've done this before! Scratching my head...I need this to work so that I can automatically select from dozens of tables (or arrays) of data based on user input.
So, I have a dropdown that contains list elements name1, name2, name3 in cell a1 which are named ranges on separate tabs
another dropdown contains list elements size1, size2, size3 in cell a2
another dropdown contains list elements color1, color2, color3 in cell a3
I use match to find the column number for size...match(A2,A1,0) results in b2
I use vlookup to find the cost...vlookup(a3,a1,b2,false)
The trouble seems to be I can't use a1 in the array argument for match or vlookup, but I need to be able to look at different tables based on user input
Last edited by davidcmichael; 02-17-2011 at 10:04 AM. Reason: on advice from moderator
To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.
If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.
Doing this will ensure you get the result you need!
This is the suggested attached workbook
I'm pretty sure I've solved my own problem with this:
=INDEX(INDIRECT(A1),MATCH(A3,INDIRECT("'"&A1&"'!a2:a4"),0)+1,MATCH(A2,INDIRECT("'"&A1&"'!B1:D1"),0)+ 1)
It works in my test workbook anyway.
If anyone can come up with a non-volatile solution I'd be grateful!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks