Excel Formula Functions

S

Steve K

Can someone give me the correct syntax for building a Lookup () formula.

The user will give me sheet name (i.e. Sheet1) and I want to use that value
to build the formula. What is the correct way to use Sheet1 to build the
formula. Specifically, where do the quotes and double quotes go to build teh
User Entered Value for teh Sheet and Range Name?

=Vlookup(23, User Entered Value Here for worksheet and Range Name, 3)
 
D

Don Guillett

With a formula or a macro?
How do you get the info from the user.
Show us your efforts so far.
 
S

Steve K

I use a simple woksheet and ask the user to provide a lookup value
Lookup value=25 (cell=A1)
and a region (that corresponds to a a data range on a tab in the workbook.
Region=met1sur1 (cell=A2)
and miles
Miles=100 (cell=A3)
As I get the user input, I build the formula:

When the user enters the region name (met1sur1), I need to enter the literal
into the Vlookup so the formula knows what sheet the data table resides. So
it would look something like this:

=Vlookup(A1,A2!dataRange,A3)

In order to get the formula to evaluate, I need the correct syntax (quotes
and double quotes to enter the value entered in cell A2 (met1sur1).

=Vlookup(25,"'"&met1sur1!dataRange"'",100)

Thanks
 
D

Don Guillett

You need to use INDIRECT. Look up in the help INDEX
Here is the basic idea

=IF(ISNUMBER(D5),VLOOKUP($A5,INDIRECT("Data!B1:X1000"),5,FALSE),"")
 

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