I just decided to do this. I’ve been meaning to learn more about the vlookup function in Excel. I figured this one would be a semi-useful template for you to use. This is best used on Excel 2010.

The way to use the sheet is just to copy and paste all of the zipcodes in the first column then the rest is magic.

**Download**

Zip-Codes-to-City-County-State-2020 (xlsx) – Updated April 2020

Zip Codes to City State 2019 Leading Zeros (xlsx) – Updated December 2019

Zip Codes to City State (xlsx) – Updated January 2019

Zip Codes to City State with Acceptable Cities (xlsx) – Updated January 2019

BETA Download

City-State-to-ZipCode-2020 (xlsx) – Updated May 2020

So helpful, thank you!

This is amazing! Thank you!

Excellent work! Just was asked by my boss to list employees by state, and my list was all zip codes! Worked like a charm!

Oh, zips which begin with zeros are not in the vlookup table, Connecticut, Massachusetts, Maine, New Hampshire, New Jersey, Rhode Island, and Vermont.

Thanks!

correction!!! zips with zeros do work! I had them all in my spreadsheet like this—> ‘06010

This is so awesome. Thanks for your work

This is awesome thanks

Thanks! Let me know if you need any modifications to it.

Hi Edel,

Question for you. Some zip codes have multiple (“acceptable cities”), but the vlookup stops at the first one. I love the granularity you offer, but it doesn’t pull those zip codes … often it’ll just pull the big city (i.e. Saint Louis). How can I modify it so that it pulls all “acceptable cities” for that zip code?

Thanks for your awesome work.

Hi D,

Thank you for the comment. I added a new one to add the alternate cities in the list. Let me know if you have any electronic drum set recommendations. I need to get rid of my rig. Thanks.

This is a life saver!

Thanks Chad! Glad it worked out.

Is there some reason when I copy my list it returns #n/a error but if i then format cell and retype the zip code the vlookup works?

The copy paste function returns #n/a error for me. If I copy format and then retype the zip code in the vlookup works. What causes this? Defeats the copy and past of my zip code list. Assume there is something silly going on with me.

Hi John,

I’m trying a couple of situations but I can’t replicate it. Can you send me your original list?

I sent you the file to your email address. Any luck?

Was there a reply on that last comment? I am having the same issue. When I copy and past most say n/a. When I type the zip code in manually it works. Is there a fix to this?

You. Are. The. Best. Thank you!

Hi Mark,

Worked a while on John’s file. The problem we encountered is that the cells with the zipcodes have a hidden apostrophe. It looks like the apostrophes came in during an export from another system. What you might be able to do is to select the column, right click on the data and select Format Cells. Under the Number tab, make sure Number is selected. It might be text. Click OK and then try to copy/paste it again.

Another option if you’re dealing with a big chunk of data is to try to remove the apostrophe by doing a text-to-column. This fastest solution I found so far: highlight the column, go to data, then text-to-columns, select delimited, then make one of the choices to be an apostrophe.

Let me know if that works. I think there’s also an option to paste as value but we found that it still carried over the apostrophe. Keep us posted!

Amazing! Thank you so much!

Any plans on making one with area codes?

Nope but that’s a great idea! Will add to the task lists.

Hi Edel,

I’m running into the same issue as John did. However, even though ran text to columns to remove the apostrophes and formatted the column as numbers, I’m still getting N/A for about 2/3rds of the file. Do you know of any other causes of this issue?

Interesting, if I paste zip codes that start with zero in the top part of the spreadsheet where you formatted with the formula it works. If I copy and paste the formula to extend I get N/As. Can you extend your formatting to include more rows?

Hi Christian,

So far, the only cause has been that some programs/databases export and hide that apostrophe. Have you tried cutting, then pasting into notepad, and then copying from notepad back into the excel sheet?

Hi Kathryn,

Thanks for using the spreadsheet. The first document goes all the way to 200 rows. The second almost reaches excel’s end. Are you working with more than 200 rows? Thanks.

Yes – and the zipcodes are on the second tab but show NA on the first tab.

Hi Kathryn,

Thank you so much for catching that. I updated the files. Please download and test them. Let me know if it works.

For everyone,

Dollar Signs ($) matter in the real world and programming world too.

Hi

No idea what I am doing wrong but I copy and paste and nothing happens. Is there a trick? Thanks PG

Hi PG,

Thanks for using the tool. When you cut and paste, do you see anything like this video? https://youtu.be/rq7AFo9a4yQ

You LITERALLY saved me so much time. I had 4,933 zip codes that needed a city. I am ETERNALLY grateful.

Awesome! Glad it helped!

Hi Edel, How impossible would it be to add “county” column?

Great tool!

Hi Tyler,

Not impossible…I’m looking for the data set now. That’s the difficult part.

Great tool! I am trying to add by region also. There was a programmer from Walmart who shared a similar program but adding cities provides more accurate shopping data and the addition of regions makes it all powerful.

Wow!

Huge time saver!

tks for your help.

THANK YOU!!

HI Edel, is there a file for the reverse? That will take a full street address without a zip code and convert and add in a zip code?

Hi Andrew, sorry, I don’t have that one. Wait, do you have City/State too?

Really appreciate your work. Thank you.

Thank you so much!! Enormous help.

This is very helpful for me, do you also have a way to do it with population?

Census block or city population?

Hi Edel Alon,

Thanks for responding.

I am not pretty sure but I thinks it is city population, as I am searching on google manually like this “Cantonment FL population” I am trying to find any excel code to find the population of the city using the city or zipcode but I am not able to find any on google

Ahhh…do you have a certain state? I might be able to make something for you that returns something like this: https://www.california-demographics.com/zip_codes_by_population

for now Florida and Texas is what I am trying to figure out.

Hi jodenzle,

Give this one a shot: https://edelalon.com/blog/2019/05/zipcode-to-city-state-and-population-excel-spreadsheet/ Let me know if it works/doesn’t work for you. Unfortunately, I cannot promise how accurate the data is. I grabbed the numbers from https://www.louisiana-demographics.com/zip_codes_by_population and https://www.texas-demographics.com/zip_codes_by_population.

Hope this works out for you.

Thank you! Amazing time saver for a school survey project. Real Deal!

Hi Edel Alon,

Thanks a lot! I am currently trying this one and so far it works the best. I really appreciate this.

Regards,

Joden

This is great. Thanks so much for making this.

What is the source for the zip codes?

Hi Gerry,

I forgot exactly but I’m pretty sure it was from this site: https://catalog.data.gov/dataset/zip-codes-zipcodes

If you have another dataset, I can make the workbook for you.

Can this do the same thing but the other way round, I have city and state, but have to look all the zip codes up seperately.

Hi James, it does not do the same. Let me try to reverse engineer it.

Hi James,

What does your data look like? Each city and state in their own column?

CITY | STATE

You rock brother. I’d appreciate anything you could do for me.

Do you have an international postal code template? i have zips from around the world and need their country’s name

Any chance to get this to include County?

Thanks!

Nevermind I figured it out! Just change the very last number in the code to “7”

wow thank you for this

Is this form working, I pasted my zip code now what?

Am i supposed to erase the other data?

Hi Keith,

After pasting your zip codes in the first column, you should see the changes on the right. What do you see now?

This is so great Edel!!! One tip for those that go to copy in their list of zip codes and it returns an N/A, make sure you convert your data to an actual number. My zips were in text form, so I had to convert them to general and then “poof”, like magic, Edel saved me so much time and work 🙂

One request would be for you to add population data for those zips. Very daunting task, but would be very useful!

Thank you Edel, this worked great and you saved me a ton of time

Thanks Candice,

That’s in the works…after we get the census results.

You’re welcome!

Hello,

This is EXACTLY what I need but I don’t know how to use it past the 5 rows already set up. Can you help?

I would like to integrate it into an existing spreadsheet.

THANK YOU

Hi Jeff,

I think I understand the situation. The best thing to do is copy the cells above and paste them below. Let me know if that doesn’t do the trick.

I don’t generally leave comments, but this is the most amazing thing I never knew I needed.

Awesome!

Glad it worked out for you.

Hello Edel,

I have a file with around 6,000 zip codes and when I paste it into your Excel sheet it is only returning about 1500 of the city and states. Not sure how to return all the city and states for the entire 6,000 zip codes.

Also, all the zips that start with a zero are not returning values. Zips with zeros return #NA.

Amazing tool. Thank you so much. I normally google all my excel needs and yours was the most efficient and easy solution.

Hi John,

Thanks for reaching out. Are the ones missing all at the bottom or some lines are missing? If all at the bottom, you can copy the blank cells that work and paste them into the ones that do not work. I purposely did not extend the file past 1500 rows…or around there to keep the file size low. Or, after you paste in your zips, highlight one of the rows that works all the way to the bottom of the file. Then hit CTRL-D on your keyboard to Fill Down.

Let me know these don’t work.

Ah, I see what’s going on. The zipcodes that start with zero are pasting in as text, not a number. I would follow the information on this page to make sure the cells are formatted to have a leading zero as a number not text. https://www.ablebits.com/office-addins-blog/2017/01/18/add-leading-zeros-excel/ And then on my sheet, do the same. I’ll post up a new version that helps retain that leading zero.

I modified the file you sent me and sent it back. I saw some that did not return an area code but at least added the city.

OMG, Edel. This is a gift! You saved me two hours of work. Thank you!

You’re welcome! Happy new year!

Thank you! This saved me so much time!

Glad it worked out for you Frankie!

Outstanding!

Thank you so much, Edel! You don’t know how much this has helped me today. I had been working on a project all day only to lose everything. Your formulas saved me so much time and stress. Thank you, again!

Appreciate your work! TY

Cool. Glad it worked out for you!

Edel – great tool. I have the same question as a few above – would you be able to include a column for Counties? I have been trying unsuccessfully using the excel forum: https://www.excelforum.com/excel-formulas-and-functions/1187132-how-to-auto-fill-counties-by-zipcode-in-excel.html

This apparently contains the zip file for counties but I am far from an excel wizard. Thank you.

Hi Ethan,

I’ll take a look. I might need to pull another data set. Will keep you posted.

Hi Ethan,

I did not get a copy from the forum (I didn’t bother to create an account to login). I did pull some county information. Please take a look at this sheet to see if it works for you. https://edelalon.com/blog/wp-content/uploads/2013/09/Zip-Codes-to-City-County-State-2020.xlsx

Let me know if this is what you were looking for. Thanks for reaching out, I’ve added this to my list of downloads.

Hello Edel,

Thank you. I really appreciate you taking the time to respond to my question and figuring out my issue – you’re solution works perfectly/extremely time saving and impressive!

Thank you again,

Ethan

You’re welcome. I’m glad it worked out for you. Have a great time sheltering in place.

Thank you so so so much for this! Life saver!

Question- is there a way we can bulk put in City, State, and then all zip codes would come out? Sort of the opposite here? If you built this out would be happy to venmo you!

Hmmm…I think that’s possible. Please hold.

Hi Megan,

I have something but I’m not happy with it. The problem is that many cities have multiple zip codes. This sheet will return the first zip code that matches. Here’s a link: https://edelalon.com/blog/wp-content/uploads/2020/05/City-State-to-ZipCode-2020.xlsx

I’m working on another solution.

Hi Megan,

Here’s a solution that will return all the zip code of a city you type. But you have to type the exact city and state: http://edelalon.com/zip