View Single Post
  #3   Report Post  
ricklongbow ricklongbow is offline
Junior Member
 
Posts: 5
Default

Quote:
Originally Posted by joeu2004[_2_] View Post
"ricklongbow" <rick at weinsteinz dot com wrote:
I have two worksheets A and B. Both contain
columns of five digit zip code values. A is of names and address
(street/city/state/zip different columns) with 3500 rows. B is a sheet
with every zip, city, state and county in the US. B is sorted by zip.
For each contact in A I want to lookup the same zip in B and
copy(merge?) the appropriate (same row) county into A.

[....]
Do the sheets need to be sorted ascending by zip to do the lookup?


That depends on which lookup function that you use. In any case, it would
only be necessary that the lookup column in sheet B be in ascending order by
zip code. And the lookup is __many_times__ more efficient if it is. But you
said it already is. Good choice!

To be clear, the data in sheet A can be in any order.

You were not clear exactly where you want to put the looked-up county into
sheet A. You can insert a column before the zip code column, or you can use
any column to the right.

Suppose your data in sheet B are in A2:D100000, and your data in sheet A are
in columns A:D starting in row 2. Put the following formula into E2 and
copy down:

=VLOOKUP(D2,'sheet B'!$A$2:$D$100000,4)
Thank you very much. I'm not sure I understand the syntax as I'm a bit new at this. With these actual parameters what would the formula be?

Sheet B (named ZIP_CODES) - 5 digit zips are in cells A2:42742. Ascending sort. Counties are D2:42742

Sheet A (named emergency contacts) 5 digit zips are in N2:2709. Ascending sort. I want to return couties into Q2:2709.

Sheet A actually extends out to CP. Where would I insert the formula? And how do I execute it once copied in?

Pardon my needs for beginners explaination but that is what I am ! Thank you very much.

Last edited by ricklongbow : January 10th 13 at 05:31 AM