How do i see travel tim in g-doc?

5 posts / 0 new
Last post
iggn
How do i see travel tim in g-doc?

Hi there,

i'm not a developer, first of all. So please be kind to me ;-).

I created a g-doc where i can determine the distance between two adresses in kilometers. Now i would like to add the travel time too. I found a post where it states that mapquest could deliver this information with this formula:

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

I created the mapqtest key, enterd it into the formula and it worked for one calculation and then never again. What am i doing wrong?

Thanks for your help!

Cheers

Mikko

 


MQBrianCoakley
Good question. I've never
Good question. I've never heard of putting a link as a formula in a spreadsheet. Anyone else tried this? In theory, as long as the origin and destination are set correctly, the path to the formattedTime is correct. But it sounds like you want distance, so //response/route/distance may be what you're looking for.

iggn
well...

Hi Brian,
thanks for your swift response! Well, it works now but without stability. Sometimes it shows me the traveltime, sometimes not. Don't know why. My goal is to see distances (in kilometers) and travel Time for around 30.000 start adresses to around 50 end adresses. 

Your code works, but i wonder if it shows the distance in miles?

Thanks! Mikko


iggn
well...

Hi Brian,
thanks for your swift response! Well, it works now but without stability. Sometimes it shows me the traveltime, sometimes not. Don't know why. My goal is to see distances (in kilometers) and travel Time for around 30.000 start adresses to around 50 end adresses. 

Your code works, but i wonder if it shows the distance in miles?

Thanks! Mikko


MQBrianCoakley
In the distance formula add
In the distance formula add the unit parameter with the value k for kilometers. The directions api returns miles by default. It would look something like ...&unit=k&...