The Scenario
You run logistics for a small courier company. Every morning a dispatcher pastes the day's twenty delivery stops into column A of a Google Sheet, with the depot address sitting in cell B1. Your job is to produce the optimized run sheet — stops in the order the driver should visit them, with estimated arrival times — before the van leaves at 7:30 AM. You used to spend forty minutes doing this by hand with Google Maps open in one tab and the sheet in another.
The bad version:
- Geocode all twenty addresses manually or through a tool, then paste the coordinates somewhere.
- Open the Mapbox Optimization API docs, realize you need to format all waypoints as a GeoJSON array in a specific coordinate order, write the API call, and debug the response.
- Get the optimized stop sequence back as a JSON array, manually translate the index order into the actual stop addresses, and type estimated arrival times for each stop into the sheet.
It is 6:50 AM. The driver is in the parking lot.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Google Sheet. It reads the stops from column A, pulls the depot from B1, calls Mapbox to geocode everything and compute the optimal route, and writes the result — stop sequence and arrival times — directly back into the sheet.
Take the 20 addresses in column A, geocode them using Mapbox, then use Mapbox route optimization starting and ending at the depot in cell B1 and write the optimized stop sequence number into column C and the estimated arrival time into column D for each row.
What You Get
- Column C with a number from 1 to 20 indicating where each stop falls in the optimal route — row 7 might get sequence number 3, meaning it is the third stop.
- Column D with the estimated arrival time for each stop based on Mapbox's routing and a 7:30 AM departure time.
- Any stop Mapbox cannot geocode appears with "UNRESOLVED" in column C so the dispatcher can correct it before the driver leaves.
What If the Data Is Not Quite Ready
Some stops have time windows — the customer is only available 10 AM to noon
The basic optimization ignores time constraints. You need the route to honor delivery windows.
Geocode all addresses in column A using Mapbox. The delivery window for each stop is in column B as "HH:MM-HH:MM". Compute the optimized route using Mapbox route optimization, respecting the time windows in column B, starting and ending at the depot in cell B1. Write the stop sequence into column C and estimated arrival into column D.
The depot address changed and a few stops are in a different zone today
Three stops in column A are flagged with "ZONE B" in column E and need to be routed separately from the main run.
Split the stops in column A into two groups based on column E: blank = main route, "ZONE B" = secondary route. Optimize each group separately using Mapbox starting from the depot in B1. Write the main route sequence into column C and the Zone B sequence into column F, with arrival times in columns D and G respectively.
You want the sheet sorted by drive order rather than stop-sequence column
The driver finds it easier to read down column A in order rather than looking up sequence numbers.
Use Mapbox to find the best driving order for all stops in column A, then overwrite column A with the stops sorted by optimal visit order and put travel times between consecutive stops in column B.
Full pipeline: validate addresses, optimize route, flag unreachable stops, and export a driver summary
First, check all addresses in column A for obvious formatting issues — missing city or ZIP — and flag those rows in column E as NEEDS REVIEW. Then geocode the remaining rows using Mapbox and compute the optimized route starting and ending at the depot in B1. Write the sequence number into column C and arrival time into column D. Finally, create a new tab called Driver Sheet with columns listing stop number, address, arrival time, and a blank Notes column for the driver to fill in.
One prompt covers validation, optimization, and report generation.
Try It
Get the 7-day free trial of SheetXAI and open your delivery stop sheet tomorrow morning before the van leaves — paste in the stops, ask SheetXAI to optimize the route through Mapbox, and get a sequenced run sheet with arrival times in under a minute. The driving-time matrix article covers the point-to-point analysis version if you need to compare durations across many origin-destination pairs instead. The Mapbox hub covers every geographic workflow.
