Calculate Distance Between Zip Codes Vba Excel

Posted on  by
Posted by2 years ago

Excel Programming / VBA / Macros. But my hunch is that you are not going to get useable results using zip codes. Calculate distance between two addresses. Mar 27, 2008  For all general questions relating to Excel but not including VBA. Excel which computers distance between Zip codes. Calculate Distance Between 2.

Archived

So I'm doing research for a internship where I received all this customer data and am being asked to calculate the distance between the consumer zip code (i don't have their original location so I'd have to have it pull that info into new cells too) and 5 other locations. I know on google sheets there's a maps API key you can add but it only lets you do like 5 a day and I have a hell of a lot more than that. I was just wondering if you could explain in the most simplistic way possible how to do this on excel rather than searching each one on maps. Any help would be greatly appreciated!

PS my boss said he's not sure how to do this but said to ask Reddit

8 comments
Active8 years, 2 months ago

I have a spreadsheet of addresses and I need to calculate the distance between all of their zip codes and my zip code. I'm fairly flexible on the method used, but I'm hoping for some sort of webservice or mathematic algorithm. US addresses only. Basically I need to feed in 2 zip codes and get out the distance between them.

I'm willing to use Excel formulas or VBA, and I can even code something in C#.net if needed.

How would you go about calculating these distances?

Jean-François Corbett
29.5k22 gold badges113 silver badges165 bronze badges
MAW74656MAW74656
1,40618 gold badges60 silver badges104 bronze badges

2 Answers

It's pretty simple actually. Download a database of zip codes' GPS coordinates, there's plenty of sites that have this data available for download. They would list the coordinates for the center of the zip code.

Use a formula to calculate shortest distance: (ex: http://www.movable-type.co.uk/scripts/latlong.html)

Click here to purchase the full version of Decipher Backup Repair to immediately fix your corrupt iPhone backup. Decipher backup repair. Software upgrades and updates are free forever and is attentive and quick to respond if you ever have an issue.

MichaelPMichaelP

Excel Calculate Distance Between Addresses

You could use Latitude and Longitude.

Excel:

VB.net imports System.Math

Other Useful Links(First one also mentions VBA alternatives)

ExcelLatLong (Also mentions VBA alternatives)

Zip Code Distance Calculator Excel

EDIT: Link added due to comment discussion

Community
sealz

Distance Between Two Locations Excel

sealz

Driving Distance Between Zip Codes

4,6305 gold badges33 silver badges67 bronze badges

Not the answer you're looking for? Browse other questions tagged excelvbadistancezipcode or ask your own question.