+ Reply to Thread
Results 1 to 4 of 4

Trying to use a VLOOKUP to match data...

  1. #1
    Registered User
    Join Date
    06-24-2011
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Smile Trying to use a VLOOKUP to match data...

    Hello everyone!
    I am new to using VLOOKUPs, and I was helped greatly by davegugg in an earlier thread, but I have a lot to learn.
    I need some help in comparing and entering in data in excel using vlookups.

    I currently have a list of ZIP codes for a group of contacts in one Excel 2003 workbook. As an example, the sheet looks like this:

    ZIP Code | County
    01001 empty
    01060 empty
    01301 empty
    01550 empty

    I need to get the county information for each of these ZIP codes. On a separate workbook, I have a list of every single ZIP code in the country and its corresponding county, like this:

    ZIP Code | County
    01001 Marcus
    01002 Hampden
    01003 Hampden
    01004 King
    01005 King
    01006 Albany
    ...and so on until 97819. That's a lot of counties and ZIP codes.


    I need to have the first workbook's ZIP codes access the second workbook's codes, and then grab the corresponding county. Is this possible?
    I have tried numerous times to do a vlookup, but it just keeps giving me zeros all the way down.

    Any advice would be greatly appreciated!

    Thanks,
    Jon
    Last edited by JonnyNYC90; 06-27-2011 at 11:25 AM. Reason: Solved the problem at hand.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Trying to use a VLOOKUP to match data...

    With both workbooks open, did you try:

    =VLOOKUP(A2,'[Workbook B.xls]Sheet1'!A:B,2,0)

    where A2 is first ZipCode in the workbook you are trying to get data into, and Workbook B.xls is the name of the other workbook and Sheet1 is the sheet the table is contained in and columns A:B are populated with Zip codes and Counties...

    After you close the source book, the path should populate in the formula.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Trying to use a VLOOKUP to match data...

    Hi Jon

    Let's assume your second book with all the codes is called ZIPS.

    then in the first workbook in B1 enter
    =VLOOKUP(A2,[ZIPS.xls]Sheet1!$A:$B,2,0)

    This assumes that the information is held upon Sheet1 of Book ZIPS. If not, then amend accordingly.

    But basically, if addressing another workbook, include the full workbook name within square brackets [c:\MyDocuments\ZIPS.xls] then add the Sheet name followed by a n exclamation mark ! followed by the range.
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  4. #4
    Registered User
    Join Date
    06-24-2011
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2010
    Posts
    15

    Thumbs up Re: Trying to use a VLOOKUP to match data...

    Hi NBVC and Roger,
    I just solved the problem.
    What happened was that in trying to match the ZIP code values, my first set of ZIP codes was actually a VLOOKUP itself, pulled from another set of data. Therefore, Excel did not have actual numbers to match with my other ZIP code database, instead it was trying to match a formula. I did a Copy and Paste Special to get just the values of my VLOOKUP ZIP codes, and then it worked like a charm. I did exactly as you both suggested and accessed the other file in my new VLOOKUP. It worked perfectly.

    Thank you so much for your help! I really appreciate it...I can now continue on with my day and get this done!

    Many thanks,
    Jon

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1