Back to Geoapify in Excel
SheetXAI logo
Geoapify logo
Geoapify · Excel Guide

Build a Travel Time Matrix From Depot and Delivery Addresses in an Excel workbook

2026-05-14
5 min read

The Scenario

The dispatch team at a last-mile delivery company has 20 depot addresses and 100 customer stops loaded into an Excel workbook from this morning's order feed. Their routing software needs a travel time matrix — every depot to every customer, in minutes — before the drivers can be assigned. The person who used to generate that matrix with a custom script left last month. The script is somewhere on a server nobody can log into.

The bad version:

  • Find a route matrix API, figure out the request format for an origin-destination matrix, and either write a new script or find an existing tool that can handle 20x100 pairs.
  • Discover that the API returns the matrix in a flattened JSON array indexed by position, and spend an hour writing the logic to expand it into a grid that matches the workbook's row and column layout.
  • Paste the result into a new worksheet, realize the row order does not match the original depot list, and manually re-sort 2,000 cells.

Drivers are supposed to leave the depot at 7 AM. The matrix needs to be in the routing tool before then, and it is currently 5:30 AM.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Excel workbook. It reads both address lists, calls Geoapify's route matrix API, and writes the resulting travel time and distance values into the correct cells — structured as a grid the routing tool can consume.

Calculate driving distance and travel time from each warehouse in column A to each delivery stop in column B using Geoapify route matrix, and write distance (km) and time (min) into columns C and D

What You Get

  • Column C receives the driving distance in kilometers for each depot-customer pair.
  • Column D receives the travel time in minutes for the same pair.
  • Row and column identifiers match the original address order so the routing tool can join them without manual reindexing.

What If the Data Is Not Quite Ready

Addresses need geocoding before the matrix can be computed

Geocode all depot addresses in the Depots worksheet and all customer addresses in the Customers worksheet using Geoapify — then compute a driving time matrix between all pairs and write the result into a new Matrix worksheet

The matrix should show both distance and time in a grid layout rather than row pairs

Use Geoapify to compute a full driving time matrix between all 20 depots in the Depots worksheet and all 100 customers in the Customers worksheet — write the result as a grid in a new Matrix worksheet, with depots along rows and customers along columns, each cell containing travel time in minutes

Only compute the matrix for stops assigned to a specific region flag

Filter the customer rows in the Customers worksheet to only those where the Region column equals North, then compute a Geoapify travel time matrix between all depot addresses and those filtered customers, and write the results into the North Matrix worksheet

Geocode addresses, compute the full matrix, and flag any depot-customer pairs where travel time exceeds the SLA threshold

Geocode both address lists in the Depots and Customers worksheets using Geoapify, compute a full driving time matrix, write it into a new Matrix worksheet, and flag any cell where travel time exceeds 45 minutes so the dispatch team can see SLA risks at a glance

All four steps run in a single instruction — no intermediate exports or manual joins.

Try It

Get the 7-day free trial of SheetXAI and open any Excel workbook with origin and destination address lists — whether it is depot-to-customer, hub-to-hub, or field-team-to-site — and ask it to build the matrix. See the sibling spoke on optimizing multi-stop delivery routes, or return to the Geoapify hub.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more