Monday, December 23, 2024
728x90
HomeTechnologyZipcode to City, State Excel Spreadsheet

Zipcode to City, State Excel Spreadsheet

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

Edel Alon
Edel Alonhttps://edelalon.com
Edel-Ryan Alon is a starving musician, failed artist, connoisseur of fine foods, aspiring entrepreneur, husband, father of two, geek by day, cook by night, and an all around great guy.
RELATED ARTICLES

159 COMMENTS

  1. 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!

  2. 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.

  3. 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?

  4. 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.

  5. 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?

  6. 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!

  7. 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?

  8. 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?

  9. 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?

  10. 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.

  11. 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.

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

  13. 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.

  14. 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?

  15. 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

  16. 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

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

  18. 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!

  19. 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

  20. 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.

  21. 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.

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

  23. 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.

  24. 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!

  25. 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

  26. 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!

  27. Hi there, I just tried the 2020 version and it didn’t work for me. I get #N/A in all the cells with IF/Vlookup formulas.

  28. Correction, the 2020 version works, but only if I manually type in the zip codes. If I paste them, I get #N/A.

    Any idea why?

  29. Hi Ray,
    We’ve noticed that the problem might be that the source (where you’re copying from) is formatted as “text”. The fix has been to (if copying within Excel), to highlight the original, format them as a number, then copy and paste into the sheet. Let me know if that does not work. Thanks.

  30. Thanks for the quick reply, Edel! I took your advice, formatted as Number, then pasted into your doc. Unfortunately, no cigar. I also tried formatting as General, and nope. Any other suggestions?

  31. For further context, if I format the source as number, then paste into the Zip Code doc, I get #N/A. If I click into a cell with a pasted Zip, and then press Enter, the formula then populates correctly. I’m working with thousands of zip codes, so want to avoid having to use that workaround, however.

  32. Yes, we’ve seen this in the past. The original source was putting in a ‘ before the number that could not be seen. If it’s not sensitive, you can email me the file so I can take a look at it.

    Email me file if you want me to take a look. 

  33. I have a data set from CT that simply will not past. I have tried converting the zip codes to number wiping out the front zeros but it still wont run ? ANy suggestion ? This looks like it could be a useful tool

  34. Hi Russell,
    Have you tried copying your data into notepad and then copying it from notepad to the excel file? That usually does the trick.

  35. Thank you so much for this. This helped me tremendously. Please don’t delete this blog as I am sure it will help more people in the future!

  36. Hey that was really helpful. Thanks a bunch for just providing that free without making people jump through a ton of hoops. 🙂

  37. This is amazing. been looking for something like this!! my data stops showing up after ~530 zips. is there a hard stop? Or is this a human error? i tried looking thru comments to see if anyone else had this problem – sorry if i missed the solution!

  38. Hi Margaret,
    Copy 1 row that has data and paste it in the missing cells below. I didn’t populate all the way to the bottom because it would have made the file really big.

    Let me know if this doesn’t work. Thanks.

  39. Edel, man this is awesome man! Just used the April 2020 version and it works great…minus that you have to only use 5 digit zips which is still great. I did run into one issue that I was hoping you could possibly help me wit the workaround.

    I got the zips to all populate the city and other data, however when I try to copy the city data to another spreadsheet it carries over the formula and not the result (name of city)…is there something that I’m doing wrong or could do to copy just the text names without needing the formula?

    Thank you sir!

  40. Hi Travis,
    Thank you. In the file, copy the cells you want. In the new spreadsheet, click on Home, then Paste. It will give you a few options. Choose Values, which is the 123 on the clipboard. Let me know if this doesn’t work. Thanks again for viewing.

  41. Hello Edel, do you happen to have source or citation that explains how you compile this data? I ask because I want to make sure that the output of city, state and county for a zipcode is accurate, without having to manually check every single zipcode I have in my data sheet. I also want to be able to accurately cite you for how I transformed our zipcodes into city, state and county. Thank you for your time and this amazing spreadsheet.

  42. Wow, you came to the rescue for me. I hate Excel and needed to quickly dump out state data based on a bunch of zip codes I had. This worked beautifully!

    FYI, I love your car! I’m still rocking my 2010 original Mazda Speed 3 with turbo (275 HP). Mazda almost hit the mark with the 2021 model but fell short, in my opinion. I’ve always had my eyes on the MX5.

  43. Hi Edel,
    I can’t find the true source of the data. How are you able to update it with 2020 data?
    Also, can you confirm if city column are true cities or can it represent a town?

  44. Hi Cindy,
    Looks like they took it down. I can redo with current data if you can help me find a good source. The city column is part of the original data set, they called it “city”. Let me know what you find. Thanks.

  45. Thanks Edel for responding so quickly! It looks like the city field is a combination of cities and towns or incorporated places. I guess it really depends on ones definition of a “city”. I found a suitable dataset in the following link : https://www.census.gov/data/datasets/time-series/demo/popest/2010s-total-cities-and-towns.html . It’s called “Subcounty Resident Population Estimates: April 1, 2010 to July 1, 2019 (SUB-EST2019)”, which indicates the name of the place, whether if it’s city or town, and state in case need anyone needs to do further analysis. One can compare “Accident, MD” across your file and this.

    Overall, pretty much every other data source I’ve found with “city” as a column has a mix of actual cities and towns in the field. Thanks for putting this together! Hopefully we can find a new source to update this version with the new census info coming out.

  46. Hi SM,
    Sorry, I do not have that information. It’s on my list of things to do. I do know that ESRI released a lot of free maps but I haven’t taken a look to see if it maps to zips. It could just be voting districts.

  47. Thank you so much for making this! I have a question, I’m trying to paste a large number of zips, but for some reason, data will only populate in the columns up until line 537. Any idea how to get around this? I can paste my zips in chunks of 500 to get the info I need, but it would be great if I could paste all of them at once. Thanks!

  48. Hi John,
    You’ll need to copy the cells on the right side and paste them into the blank cells down…as far as you want. I limited it because if I didn’t, the file size would be too large. Let me know if that doesn’t work for you. Thanks.

  49. Edel, thanks for the database.
    Was wondering if it is possible to type an address and then get the zip code, city, etc.?

    Thanks man

  50. Hi Seb,
    Unfortunately, not at this time. I’ve been trying to figure that one out too. There are just too many ‘100 Main Street’ addresses out there. Thanks for visiting!

  51. Thank you for putting this together and more importantly for making it available to the public. I had the impossible task of trying to determine the states from +40,000 lines of data with nothing but ship to zip codes.
    This worked great and was a huge time saver. I hope karma repays you for your work!

  52. Hi Edel! This is amazing! Wondering if you might be providing a 2023 update and how I might get notified if so? I can create it myself.. just thought I might check if you are already contemplating the work with your sources. Really appreciate your work and am so happy I stumbled onto this!

  53. Hi Edel, thank you so, so much for this amazing resource, truly!!

    Also, just a quick fyi – When I pasted a pretty large list of zips (around 9200), it only filled out the info to #537 and wouldn’t automatically do any more of them for some reason. But I was able to just manually “double-click” on the auto fill for the each column and it successfully filled in for the rest, so was not a problem. 🙂

    Figured it was something with my own excel installation, but wanted to let you know, just in case it’s helpful.

    Thank you again Edel!

  54. Hi Bob,
    Glad it worked out for you. The reason why it stopped is because if I filled it all the way to the bottom, the file would be humongous. I’m glad it worked out for you. Thanks for visiting.

    Edel

  55. Edel-
    Thanks for all your work on this, truly a tiimesaver! Only issue I have, is that Vlookup is looking at that file, so I cant copy and paste the data without having a formula behind it ( if that makes sense)

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

- Advertisment -spot_img

Read More

Check These Out