Search code examples
excelgoogle-mapsexcel-formulageolocationcoordinates

Calculate the geo-coordinates distance between two places in Excel Sheets


EDIT: Im using Exchel Online Sheets

This is what i have in a column

=importXML("http://maps.googleapis.com/maps/api/geocode/json?address"&"=A4,A5&key=MYKEYISHERE--9-W1GIAHcQb9O6fm0";"B6,B7")

This may be hard to read so let me translate. It should take the latitude from A4 and the longitude from A5 and calculate the distance to B6, B7

The first problem that im seeing is that here /geocode/json?it says JSON even tho I'm importing an XML, so I'm not sure how exactly this works, or how to work around it.

Thank you in advance


Solution

  • Robertme,

    A quick google search found this way to do the required in Google Sheets: Calculate Lat/Lon Distance Google Spreadsheet

    You'll need to combine the lat/lon columns into a concatenated field and then hand them to the DISTANCE function which will return meters between the 2