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

Batch Route Large Sets of Origin-Destination Pairs From an Excel workbook

2026-05-15
5 min read

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 the workbook, 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 workbook 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 Excel workbook. 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 workbook.

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.

What You Get

  • Distance in km written back for each row
  • Duration in minutes written back for each row
  • All 80 rows processed in a single API call
  • Blank cells for any pair TomTom couldn't route — easy to spot before the model runs

What If the Data Is Not Quite Ready

Origins and destinations are addresses, not coordinates

For all rows in this workbook, 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 workbook 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

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 workbook. 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.

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. 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 Excel workbook 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.

Stop memorizing formulas.
Tell your spreadsheet what to do.

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

Learn more