If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 > Formula for straight line distance between two waypoints

 scrtchmstj Registered User Join Date: Jan 2009 Location: Louisiana, United States Posts: 163
Formula for straight line distance between two waypoints

Here's an Excel formula for calculating the straightline distance between two waypoints, given the curvature of the earth. I put this together originally to try to determine which of our distribution centers should service which zip codes. It wasn't much use for that application but I have found many other uses for it. There are plenty of sites with zip code lists including lat and long if that is what you want to do. Latitude and longitude values must be in degrees (which is the way you'll usually see them). Just thought it might benefit others. Joshua

Quote:
 55tom55 Registered User Join Date: Nov 2012 Posts: 2
Trying to use formula for distances between waypoints.

 I am creating an application to calculate the distance between airports. I believe your formula should handle this. I have a spreadsheet with four columns titled: From Latitude, From Longitude, To Latitude, and To Longitude. The fifth column is for Distance. I plugged your formula into column 5. I get a "VALUE" error. Obviously I'm missing something here, or I have a syntax issue. I have included my first row of waypoints. I know the distance should be about 180 miles. I appreciate your comments. N58° 43' 42.01",W156° 56' 25.35" and N58° 40' 36.49",W156° 38' 57.18"
 scrtchmstj Registered User Join Date: Jan 2009 Location: Louisiana, United States Posts: 163

Tom,

I'm attaching a spreadsheet calculator used to calculate the distance between zip codes using their lat/long. You can either set the from/to zip in the top section to see the distance between the two or set the from and look at the zip codes in the bottom section to see how far each is from the "from" zip code. Let me know if you have any other questions. Make sure you are working with degrees or radians as needed. That can be a little confusing.

Joshua
Attached Files
 Zip Codes - Straight line distance between 2 points.zip (3.15 MB, 28 views)
 55tom55 Registered User Join Date: Nov 2012 Posts: 2
Distance between two waypoints

 Thanks Joshua. That spreadsheet is exactly what I was looking for. Tom