Calculating trip distance using Excel spreadsheet

doxadevelopment

New Member
Joined
Apr 8, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Dear all,

I am having trouble with adding a formula in the Excel cell for calculating the trip distance between two destinations. Does it have to link to Google map?

Thank you.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I answered a similar question today. See post#12 in this thread using GoogleMaps API.


Example:
Book1
ABCDE
1OriginDestinationDistanceDuration
2Dallas, TexasIrving, California2,287 km20 hours 38 mins
3RG8 7JFWA7 5PS299 km3 hours 17 mins
475094945592,824 km1 day 2 hours
5Disney Land, FloridaSpace Needle, Seattle4,959 km1 day 21 hours
6
Sheet1
Cell Formulas
RangeFormula
C2:C5C2=GetDistance(A2,B2)
D2:D5D2=GetDuration(A2,B2)
 
Upvote 0
I answered a similar question today. See post#12 in this thread using GoogleMaps API.


Example:
Book1
ABCDE
1OriginDestinationDistanceDuration
2Dallas, TexasIrving, California2,287 km20 hours 38 mins
3RG8 7JFWA7 5PS299 km3 hours 17 mins
475094945592,824 km1 day 2 hours
5Disney Land, FloridaSpace Needle, Seattle4,959 km1 day 21 hours
6
Sheet1
Cell Formulas
RangeFormula
C2:C5C2=GetDistance(A2,B2)
D2:D5D2=GetDuration(A2,B2)
Hi Cubist,

Do I have to download Google API?

Thank you.
 
Upvote 0
Hi Cubist,

Do I have to download Google API?

Thank you.
You don't have to download it but must make an account. The free version is fine depending on your purpose. All you need is an API Key and replace that in the code provided in the other thread. See this link on how to get started.
 
Upvote 0

Forum statistics

Threads
1,215,254
Messages
6,123,894
Members
449,132
Latest member
Rosie14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top