I recently had a need to calculate distance between a large number of latitude/longitude coordinate pairs. There are many options available if you want to import these in a GIS and run analysis. But there is a simpler and much more accesible way if you aren't doing very high accuracy calculations.

I decided to write a simple Macro or AppScript for Google Spreadsheets, which uses the well-known Haversine formula to calculate distance between 2 coordinates. Once the script is saved, the user of the spreadsheet can use the function 'distance()' just the way one uses any of the built-in functions.

forumla to calculate distance.

You can give it a try. Just open this spreadsheet, make a copy it and play with it as you like.


comments powered by Disqus