The Scenario
A real estate analyst built an Excel workbook with twenty property addresses in column A and five school addresses in column E. The VP of acquisitions wants a driving-time matrix before the investment committee call Friday morning. You inherited the task when the analyst left for vacation Wednesday morning.
The bad version:
- Read the Mapbox Matrix API docs, discover you need to geocode all twenty-five addresses before the matrix call.
- Write or copy a script, debug the JSON response, figure out that the matrix API accepts at most 25 pairs per request and your 20x5 grid requires pagination.
- Reshape the flat result list into the grid format the committee actually wants to read.
The committee call is at 9 AM Friday.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Excel workbook. It reads the property and school addresses, calls Mapbox to geocode them and compute the driving-time matrix, and writes the result grid directly into the workbook.
Use the Mapbox travel time matrix to calculate driving durations in minutes between all origin addresses in column A and destination addresses in column E, then fill the results starting at cell G2 as a grid — rows correspond to properties in column A, columns correspond to schools in column E.
What You Get
- A 20x5 grid starting at G2 with driving time in minutes for each property-school pair.
- Header row in G1:K1 with school names from column E.
- Any pair Mapbox cannot resolve shows N/A rather than a blank that looks like zero.
What If the Data Is Not Quite Ready
Some property addresses are missing city or ZIP
Before computing the matrix, check column A for addresses that appear to be missing a city. For each incomplete address, use context from surrounding rows to fill in the city field. Then run the driving-time matrix using Mapbox and fill the grid starting at G2.
You need driving times and straight-line distances side by side
Compute a driving-time matrix in minutes using Mapbox for all origin-destination pairs and write it starting at G2. Then compute the straight-line distance in kilometers for each pair and write it into a second grid starting at M2.
The school list is on a separate worksheet
Compute a Mapbox driving-time matrix between all addresses in column A of the Properties worksheet and all addresses in column A of the Schools worksheet. Write the result grid to a new worksheet called Drive Times, with property addresses as row labels and school names as column headers.
Full pipeline: geocode, compute matrix, flag long commutes, and sort by average drive time
Geocode all addresses in column A and column E using Mapbox. Compute the full driving-time matrix and fill it starting at G2. Add a column F called Avg Drive Time averaging each property row across all five schools. Highlight any cell above 20 minutes with LONG in the corresponding column G. Sort the entire dataset by column F ascending.
One prompt handles geocoding, matrix computation, aggregation, and sorting.
Try It
Get the 7-day free trial of SheetXAI and open the next property analysis workbook your team hands you — describe the matrix shape you need and let SheetXAI call Mapbox and build the grid. The route optimization article covers multi-stop sequencing. The Mapbox hub has every geographic workflow.
