Solved

tweeking a vlookup

Posted on 2013-12-26
4
209 Views
Last Modified: 2013-12-26
=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.
0
Comment
Question by:dnewman33
4 Comments
 
LVL 29

Expert Comment

by:gowflow
ID: 39740132
what do you mean by:
How can I make the range more flexible

???
not clear
gowflow
0
 

Author Comment

by:dnewman33
ID: 39740174
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.
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 125 total points
ID: 39740186
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
0
 
LVL 80

Assisted Solution

by:byundt
byundt earned 125 total points
ID: 39740239
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.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How can I modify this Excel worksheet with a script? 15 46
Auto Operation of MS Excel 2013 2 29
onOpen 14 41
Rearrange Macro 7 13
Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now