What’s the expression to find the distance between 2 coordinates

Hi I have a column dedicated for LatLong in my sheet what’s the formula I can use to find the distance between 2 coordinates in 2 different cells

Solved Solved
0 12 1,574
1 ACCEPTED SOLUTION

Hi, you are looking for an expression DISTANCE(). The result is as km.

View solution in original post

12 REPLIES 12

Hi, you are looking for an expression DISTANCE(). The result is as km.

further clarification…

When I use the above expression I am getting the distance between the two co-ordinates, but it’s distance is direct point to point…

Is there a way I can get the distance via road as shown on google maps.

For instance when I put in 2 co-ordinates I m getting distance of 15.7 km in Google Maps , where’s the expression yields a result of 12.5 …

Hence I am assuming the AppSheet expression is not via road but direct points in maps

Correct, it is direct. More precisely I understand the calculation should be based on Great Circle.

Is there a way to achieve this distance calculation by road…as shown in Google maps

I don’t think so.

Is there a google api expression like the one there is for qr code generation…for this

Will certainly try this…will it also work for LatLong instead of address

hi, can we change km to miles?
also, can it calculate time based on google traffic data?

miles = km * 0.62137

No, it cannot.

I actually have a similar script for this that I have built for a quoting system.

I calculate the distance as travelled on the road not “as the crow flies”.

It then provides a quote based on either the distance, or the travel time.

With the script in your google sheet, you just need to use

=GOOGLEMAPS_TIME(A1, B1, "walking")

The only downside to this is that it require sync for the data to be shown.

Awesome!!!

Top Labels in this Space