I would like to realise a spreadsheet where the columns are as follows.

Place A Place B Distance by road between A and B Travel time by road between A and B

I thought this might be possible using the 'Google' functions of Google Docs' spreadsheet, but I've found none that does the trick.

In the end, I could knock up an app to do this using the Google Maps API, but I would rather avoid it if I can.

1 Answer 1


MapQuest seems to be the best bet, as they have a URL-based API for directions, whereas Google Maps seems to be a JavaScript library.

This worked for me in a Google Docs Spreadsheet. This one gets the distance (miles):

=importXML("http://mapquestapi.com/directions/v1/route?key=YOUR_KEY_HERE&outFormat=xml&from=" & A2 & "&to=" & B2,"//response/route/distance")

And this one gets the time (formatted in hh:mm:ss):

=importXML("http://mapquestapi.com/directions/v1/route?key=YOUR_KEY_HERE&outFormat=xml&from=" & A2 & "&to=" & B2,"//response/route/formattedTime")

where A2 is the origin and B2 is the destination.

You have to get an API key from MapQuest and replace the value YOUR_KEY_HERE with it.

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