Calculate Drive Time Between Locations
Calculate driving time and distance between locations in a spreadsheet. Generate route paths and isochrone maps for service area analysis.
You need to know how long it takes to drive between two locations -- not the straight-line distance, but the actual travel time on roads. You might also need to see the route on a map or visualize everywhere reachable within a given time.
GeoSheet computes driving times, distances, route geometries, and isochrone polygons using built-in formulas powered by Mapbox routing.
Worked Example: Delivery Time Estimates
You have a distribution center and a list of delivery addresses:
| A | B | |
|---|---|---|
| 1 | Distribution Center | 500 W Madison St, Chicago, IL |
| 2 | Customer 1 | 123 Michigan Ave, Chicago, IL |
| 3 | Customer 2 | 456 Lake Shore Dr, Evanston, IL |
| 4 | Customer 3 | 789 Galena Blvd, Aurora, IL |
| 5 | Customer 4 | 321 Main St, Naperville, IL |
Step 1: Calculate drive times
In C2, enter:
=DRIVE_TIME($B$1, B2)
Copy down to C5. Each cell shows a DURATION value -- the estimated driving time from the distribution center to that customer. Durations display in a human-readable format (e.g., "32 min" or "1 hr 15 min").
Step 2: Calculate driving distances
In D2, enter:
=DRIVE_DISTANCE($B$1, B2)
Copy down to D5. Each cell shows the road distance in kilometers.
Step 3: Generate route paths
In E2, enter:
=ROUTE($B$1, B2)
Copy down to E5. Each cell holds a LINE value representing the actual driving route. Create a map chart from column E to see all routes overlaid on a map.
Isochrone: Visualize Reachable Areas
An isochrone shows everywhere reachable from a location within a given time. This is essential for service area analysis, site selection, and coverage planning.
=ISOCHRONE(A1, 15) # Polygon of area reachable within 15 minutes
=ISOCHRONE(A1, 30) # 30-minute drive-time polygon
=ISOCHRONE(A1, 60) # 1-hour drive-time polygon
The result is a POLYGON value you can display on a map chart. Isochrones support ranges from 1 to 240 minutes.
Example: Comparing service areas
To compare coverage from two candidate warehouse locations:
| A | B | |
|---|---|---|
| 1 | Site A: 500 W Madison, Chicago | =ISOCHRONE(A1, 30) |
| 2 | Site B: 100 S Main, Naperville | =ISOCHRONE(A2, 30) |
Create a map chart from column B to see both 30-minute service areas overlaid. The overlap and gaps tell you which site provides better coverage.
How It Works
DRIVE_TIME(origin, destination) queries Mapbox Directions v5 to compute the fastest driving route and returns the estimated travel duration as a DURATION value.
DRIVE_DISTANCE(origin, destination) uses the same routing engine but returns the road distance in kilometers.
ROUTE(origin, destination) returns the full route geometry as a LINE value, following the actual road network.
ISOCHRONE(location, minutes) queries Mapbox Isochrone v1, which computes the area reachable by driving from the given point within the specified time, and returns it as a POLYGON.
All four formulas accept POINT values, cell references, or address strings. Addresses are automatically geocoded before the routing request is made.
Results are asynchronous -- cells show #PENDING while the routing/isochrone request completes, then update automatically.
Practical Applications
- Delivery planning: Estimate delivery windows by computing drive times from a warehouse to each customer
- Service area mapping: Use isochrones to visualize and compare coverage areas for fire stations, hospitals, or retail locations
- Site selection: Generate isochrones from candidate sites and check how many customers fall within each service area using CONTAINS
- Fleet management: Build a matrix of drive times between all stops to support route optimization
- SLA compliance: Flag deliveries where
=DRIVE_TIME(warehouse, customer)exceeds your service-level threshold
Combining with Other Formulas
Check if a customer is within a service area:
=CONTAINS(ISOCHRONE(warehouse, 30), customer_location)
Returns TRUE if the customer is reachable within 30 minutes.
Count customers within a service area:
=COUNTIF(MAP(B2:B100, LAMBDA(c, CONTAINS(ISOCHRONE($A$1, 30), c))), TRUE)
Next Steps
- Calculate Distance Between Addresses -- straight-line and driving distances
- Map Data in a Spreadsheet -- visualize routes and isochrones on maps
- Spatial Features -- full reference for routing, isochrones, and spatial analysis
- Using AI to Analyze Spreadsheet Data -- let Geovani handle complex routing analysis
Updated about 2 months ago