I got a question recently about how to match ZIP codes to counties, and it occurred to me this could be helpful to others! It's really easy.
You can do this trick with any of the later versions of Excel.
Step 1. Make sure your zip codes are numbers (not text) in Excel
Step 2. Highlight zip codes and select Data>Data Types>Geography
That's it! Now you will get a little "insert data" icon next to the zip codes that you can use to add other location data, like county, state, city, etc. It will show up in its own column.
Then you can map it. Oh yes I said map it!! In Excel!! I know!!
But first, you probably want to pivot so that the map shades according to frequency of zip/county. Select all the county names and select Insert>Pivot Table. Put counties as your rows and values.
To map this pivot data, you'll need to copy/paste out of the pivot format. Here I just stuck the data back on the first sheet. Then made it Geography data type again--that's an important step! (it lost that during pivoting). Then Insert>Map>Fill Map.
(note: you can do map at the Zip code level but your polygons will be so small that the boundaries will pretty much obscure the whole map)
See, it's easy right, once you know the steps! Let me know if you try it and what you think of this cool feature of Excel!
This is SO great to know about. You wouldn't believe the data gymnastics I've gone through when trying to do things like this with other tools!
ReplyDeleteAwesome information. Thanks so much!
ReplyDeleteWhich Excel versions have the geography data type? I don't see it in the 2016 version on my Extension laptop.
ReplyDeleteExcel for Microsoft 365. You can upgrade https://it.umn.edu/services-technologies/resources/office
DeleteExcellent, such a great tip to know!
ReplyDeleteSo cool! Thanks for sharing!
ReplyDeleteJust be weary that the shape of Minnesota is off- your stakeholders in Cook county aren't going to like this. We often translate mapping data into other mapping software or use the Extension maps and manually fill in colors.
ReplyDeleteCook county is definitely looking a little squashed there! lol!
DeleteI think this trick is more cumbersome now that Word is using Bing data to pull information. It seems like you have to move from zip code => city => county. I've tried this with some zip codes and it gave erroneous county results (compared to previous versions).
ReplyDeleteI am having good luck with the new process in general--which just involves converting to city first, then converting to county from that. It does not work well for St. Paul/Minneapolis, due to the city name matching to more than one county. I hope Excel will add back the "admin division 2"!
Delete