The Scenario
You're a logistics planner and the scheduling meeting is at 2 PM. You have 5 depots in one tab and 50 customer stops in another, and the routing software your company uses needs a full travel-time matrix — every depot to every customer, in minutes — before it can generate assignments. Right now you have coordinates but no matrix. The meeting is in three hours.
The bad version:
- Manually calculate each depot-to-customer combination by entering coordinates into Google Maps, reading the driving time, and typing it into a grid cell
- 5 depots times 50 customers is 250 individual lookups at about a minute each — that's four hours of work you do not have before a 2 PM meeting
- Make a lookup error at cell D17 and produce a routing plan that sends the wrong driver three hours in the wrong direction
You're supposed to walk into that meeting with a plan, not a spreadsheet full of "TODO."
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Google Sheet. It reads the depot and customer coordinates from whichever tabs and columns you specify, calls TomTom's matrix routing API, and writes the full travel-time grid back into the sheet.
Using the lat/lng coordinates in columns A and B as origins and the coordinates in columns D and E as destinations, calculate a TomTom routing matrix and write each travel time in minutes into a grid starting at cell G1
What You Get
- A grid starting at G1 with one row per origin and one column per destination
- Each cell contains the TomTom-calculated driving time in minutes for that origin-destination pair
- Empty cells where TomTom returned no route (useful for catching coordinate errors)
What If the Data Is Not Quite Ready
Origins and destinations are on separate worksheets
For the 5 depot lat/lng coordinates in the "Depots" tab columns A and B, and the 50 customer coordinates in the "Customers" tab columns A and B, build a TomTom travel-time matrix and write the result as a grid in a new tab called "Matrix" with depot names as row headers and customer IDs as column headers
You need distance in km alongside travel time
Using origin coordinates in columns A and B and destination coordinates in columns D and E, calculate a TomTom routing matrix and write travel time in minutes into the grid starting at G1, and distance in km into a second matching grid starting at G60
Some customers are inactive this week
Using coordinates in columns A and B as origins and coordinates in columns D and E as destinations, build the TomTom matrix only for rows in the destinations tab where column C says "active". Write travel times into a grid in the "Matrix" tab
Full matrix with headers and a summary row
Build a TomTom travel-time matrix using depot coordinates in the "Depots" tab (columns A and B) and customer coordinates in the "Customers" tab (columns A and B). Write the matrix into a new "Matrix" tab with depot names as row labels and customer names as column labels. Add a bottom row showing the minimum travel time to each customer across all depots.
One prompt builds the full matrix, labels it, and adds the summary row.
Try It
Get the 7-day free trial of SheetXAI and open the Google Sheet with your depot and customer coordinates, then ask it to build the TomTom travel-time matrix. If you're working on route planning more broadly, also see the waypoint optimization spoke for sequencing delivery stops.
