The Scenario
You're a supply chain analyst and you've just inherited a cost modeling project from someone who quit. There are 80 supplier-to-warehouse lane pairs in an Excel file, and the model needs actual driving distance and travel time for each lane — not straight-line estimates, real road distances. The carrier pricing team is waiting on this to finalize their rate cards. The rate card review meeting is Thursday.
Running 80 route calculations one at a time through Google Maps would take the better part of a day. TomTom has a batch routing endpoint that can handle all 80 in a single call. What you don't have is a way to submit them from a spreadsheet and get the results back into the right rows.
The bad version:
- Write an API call for the first origin-destination pair, get the route result, read distance and time, type them into columns E and F
- Copy the call structure, change the coordinates for the next pair, repeat 79 more times
- Lose your place at row 34, accidentally paste the row 33 coordinates twice, and produce a distance that's off by 200km in the carrier model
Thursday's meeting is for reviewing numbers, not for explaining why you need another week.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Google Sheet. It reads the origin and destination coordinates for all rows, submits them as a single TomTom batch routing request, and writes the results back into the sheet.
Take the origin lat/lng in columns A and B and destination lat/lng in columns C and D for all 80 rows in this sheet. Submit them as a TomTom sync batch routing request and write the distance in km and travel time in minutes into columns E and F.
What You Get
- Column E: driving distance in km for each lane
- Column F: driving time in minutes
- All 80 rows processed in a single API call, not 80 sequential ones
- Blank cells for any pair TomTom couldn't route — easy to spot and fix before the model runs
What If the Data Is Not Quite Ready
Origins and destinations are addresses, not coordinates
For all rows in this sheet, geocode the origin address in column A and destination address in column B using TomTom. Write lat/lng into columns C-D and E-F respectively, then submit all rows as a TomTom batch routing request and write distance in km and travel time in minutes into columns G and H.
You only want to route rows marked as active lanes
For all rows in this sheet where column G says "active", take the origin lat/lng in columns A and B and destination lat/lng in columns C and D. Submit them as a TomTom batch routing request and write distance in km and travel time in minutes into columns E and F for those rows only.
Batch routing across two worksheets
For all rows in my Excel sheet with origin coordinates in columns A and B and destination coordinates in columns C and D, use TomTom batch routing to calculate all routes at once and fill in the distance and duration columns.
Full carrier cost model in one pass
For all 80 rows, batch-route origins in columns A-B to destinations in columns C-D using TomTom. Write distance in km into column E and travel time in minutes into column F. Then calculate the estimated carrier cost as distance times the rate in cell H1 and write it into column G. Sum column G and put the total estimated freight cost in cell G1.
One prompt routes all 80 lanes, calculates costs, and produces the model total.
Try It
Get the 7-day free trial of SheetXAI and open the Google Sheet with your supplier-to-warehouse lane pairs, then ask it to batch route all rows using TomTom. For single origin-destination routing rather than batch, see the driving distance and time spoke.
