# tweeking a vlookup

=VLOOKUP(A2,'Wed by ZIP'!\$A\$2:\$C\$416,3,FALSE)

Simple so far.  The above is my lookup. How can I make the range more flexible without justing naming a range( I have reasons). I want to put the reference for \$c\$416  a cell reference on sheet called "Wed by ZIP" and a reference will be in cell G2. Thanks.
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PartnerCommented:
what do you mean by:
How can I make the range more flexible

???
not clear
gowflow
Author Commented:
I want the "416" to be a reference in a cell so I can easily change it to any figure based on new length of rows on the sheet. A simple reference to a cell didn't work in the formula.
Commented:
If you have the number 416 in Wed by Zip worksheet, cell G2 then try using INDEX like this

=VLOOKUP(A2,'Wed by ZIP'!\$A\$2:INDEX('Wed by ZIP'!\$C:\$C,'Wed by ZIP'!\$G\$2),3,FALSE)

INDIRECT is also possible like this

=VLOOKUP(A2,INDIRECT("'Wed by ZIP'!\$A\$2:\$C\$"&'Wed by ZIP'!\$G\$2),3,FALSE)

but INDEX is normally preferable

regards, barry

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Mechanical EngineerCommented:
On worksheet Wed by ZIP, is there anything under your table in A2:C416? If not, consider making the range of rows being searched much larger than your actual data. For example, you could use:
=VLOOKUP(A2,'Wed by ZIP'!\$A\$2:\$C\$5000,3,FALSE)

VLOOKUP starts looking for the value in A2 in the first row of the lookup table, and continues until it finds a match. There is no penalty to making the number of rows in the table far exceed your data as long as the data is found. By increasing the number of rows potentially being searched by a factor of 12, you will probably be long retired before you run into a problem with that formula.

Such an overprovisioning approach is easy to understand (by you or by others), simple to implement, and quite flexible.
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.