Biffarama

New Member
Joined
May 18, 2010
Messages
27
In my worksheet I'm trying to fill in the Zip Code column based on the City and State listed for each row. I downloaded a zip code database and added it to my worksheets a new tab in the hopes that I'd be able to use the VLOOKUP formula to populate the field from it, but I can't seem to figure it out. Looking for any help I can get with it.

Let me know if you have any questions or I haven't been clear.

Thanks in advance for your help.

Troy
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Re: Need help with VLOOKUP

Hey,

Could you give us a brief example of what the columns and rows look like for each worksheet

just maybe 1 row with all columns from each
 
Upvote 0
Re: Need help with VLOOKUP

Sure thing.

ClientLocationCityStateZip Code
1st Franklin Financial1ffc - Marketing DemoToccoaGA

<tbody>
</tbody>

ZipcodeZipCodeTypeCityStateLocationTypeLatLongLocation
705STANDARDAIBONITOPRPRIMARY18.14-66.26NA-US-PR-AIBONITO

<!--StartFragment--> <colgroup><col width="87" span="8" style="width:65pt"> </colgroup><tbody>
<!--EndFragment--></tbody>
 
Upvote 0
Re: Need help with VLOOKUP

Is it possible for you to move your column A (which is your zipcode) over to in between your 'State' column and your 'LocationType' column......

this is because you need to remember that VLOOKUP works from left to right... so we need your result to the right of your search criteria

Is this possible?

Also .. would you mind inserting a helper column? would this be an issue>? it can be hidden if desired
 
Last edited:
Upvote 0
Re: Need help with VLOOKUP

ClientLocationCityStateZipcode
1st Franklin Financial1ffc - Marketing DemoToccoaGAXXXXXX

<tbody>
</tbody>

ZipCodeTypeCityStateHelperZipcodeLocationTypeLatLongLocation
STANDARDAIBONITOPRXXXXXX
705PRIMARY18.14-66.26NA-US-PR-AIBONITO

<tbody>
</tbody>


Ok perfect so first re arrange your zipcode file in the following order... i basically moved the first column in between the 'State' column and the 'LocationType' column... then I added a 'Helper' column to the left of the zipcode column

These will be your formulas assuming all of your data begins in cell A1

XXXXXX ------ =CONCATENATE(B2,C2) ......and drag it all the way down to the end of your data

XXXXXX ------ =VLOOKUP(CONCATENATE(C2,D2),[Book2]Sheet1!$D:$E,2,0)) ...... (change "Book2" to the name of your book with the zipcodes in them and change "Sheet1" with the name of the sheet in that book. and drag this down as well and thats it!

Let me know if I need to explain anything else!
 
Upvote 0
Re: Need help with VLOOKUP

Wow.... I just now realized I was answering two different questions and i got mixed up...... my fault 100%

The above will work.... Thats not the issue

the issue is this one will work also without changing anything

=INDEX([Book2]Sheet1!$A$2:$A$10,MATCH($C2&$D2,[Book2]Sheet1!$C$2:$C$10&[Book2]Sheet1!$D$2:$D$10,0))

this is an array formula and will only work if you do CTRL + SHIFT + ENTER instead of just Enter

just change the locations of the Book2 and Sheet1 like the example above......and this is all assuming all your data for both sheets begins at A1

I am truly sorry for the mix up!
 
Last edited:
Upvote 0
Re: Need help with VLOOKUP

Thanks very much for this Nine Zero. The formula for XXXXXX worked great, but not the one for XXXXXX and I think it has to do with the set up of my workbook, so below I pasted a screenshot of the setup to see if this helps you at all?

2b4263f7-1361-400c-a5a7-f2b993e73513
 
Upvote 0
Re: Need help with VLOOKUP

your screenshot does not appear unfortunately but i am assuming it is the VLOOKUP one that didnt work....

=VLOOKUP(CONCATENATE(C2,D2),[Book2]Sheet1!$D:$E,2,0))

this will only work if the following are done

make sure that your data begins at cell A1 and the columns are in the same order you described above.

change [Book2]Sheet! to whatever your workbook is called and whatever your sheet is called ... leave the [ ] and ! symbols alone just change the text

make sure your data in the zip file also begins at A1 and the columns are in the order mentioned above
 
Upvote 0
Re: Need help with VLOOKUP

I just realized that my reply wasn't very helpful. Yes, it's the XXXXXX that I'm having trouble with.

I have two tabs on my workbook, Dealer - Locations (where XXXXXX is) and free-zipcode-database-Primary (where XXXXXX is)
 
Upvote 0

Forum statistics

Threads
1,221,525
Messages
6,160,329
Members
451,637
Latest member
hvp2262

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top