Find Distance Between Two Points with Apps Script

Curious to know how far is location A from location B? You can put the two places in separate cells in a Google Spreadsheet and then use the getDirection() function to find the distance between the two place in miles or kilometers.

Internally, it uses the Google Maps service of Apps Script to find the distance and directions between the two points. You can also use the getMileage() function to calculate the “as the crow flies” distance between any two latitude and longitude co-ordinates.