Back to Google Maps in Google Sheets
SheetXAI logo
Google Maps logo
Google Maps · Google Sheets Guide

Get Driving Route Summaries for Address Pairs in a Google Sheet

2026-05-14
5 min read

The Scenario

You're an insurance adjuster. A batch of 400 new claims came in this morning, each with a claim site address and an assigned service center. You need the driving distance and approximate travel time between each pair for the mileage reimbursement calculations — by end of business today.

The claims team used to have someone whose entire job included this step. That person retired.

The bad version:

  • Open Google Maps Directions, type the first claim address as the starting point and the service center as the destination, read the driving distance and time from the route summary
  • Switch to the sheet, find the right row, type the distance in column C and the minutes in column D
  • Repeat for claim 2, claim 3 — hit claim 15 and realize you've been using the wrong service center for the last four rows because the assignment column wasn't sorted the way you assumed

400 pairs. Typed one at a time. That's the kind of task that gets delegated to a temp, except the budget for a temp doesn't exist right now.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your Google Sheet that calls the Google Maps Directions API for each origin–destination pair and writes the route summary back to the sheet.

For each row in my Google Sheet where column A is an origin and column B is a destination, get the Google Maps driving route and write the total distance in km and duration in minutes into columns C and D

What You Get

  • Column C fills with the driving distance in kilometers for each pair
  • Column D fills with the estimated travel time in minutes
  • Rows where routing fails (unresolvable address, no road connection) get a flag in column E
  • No rows are silently skipped

What If the Data Is Not Quite Ready

The sheet has service center names, not addresses — need to resolve them first

In my Google Sheet, column A has claim site addresses and column B has service center names. Look up each service center name against the Centers tab (column A = name, column B = address) to get the address, then compute the Google Maps driving distance and duration between each claim site and its matched center. Write distance (km) into column C and duration (min) into column D.

Some claim addresses are incomplete — missing city or state

For each row in my Google Sheet, check if the address in column A contains a city and state. If not, append the state from the State column in cell F1 before computing the Google Maps route to the destination in column B. Write distance into column C and duration into column D. Flag incomplete addresses in column E.

The reimbursement policy uses miles, not km, and rounds up to the nearest half-mile

Compute the Google Maps driving route for each origin–destination pair in my Google Sheet. Convert the distance from km to miles and round up to the nearest 0.5 miles. Write the rounded distance into column C, the travel time in minutes into column D, and apply the reimbursement rate in cell H1 ($/mile) to compute the total reimbursement amount in column E.

Full reimbursement pipeline: route lookup, distance conversion, rate application, and tier flag — one prompt

For each row in my Google Sheet where column A is an origin and column B is a destination, get the Google Maps driving route. Convert distance to miles. Compute reimbursement using the rate in H1 ($/mile). Write miles into column C, minutes into column D, reimbursement amount into column E. Flag "High mileage" in column F if distance exceeds 50 miles.

One prompt covers the route math, the unit conversion, and the business logic.

Try It

Get the 7-day free trial of SheetXAI and open your claims or logistics sheet — ask SheetXAI to compute the route summary for every origin–destination pair. For large routing datasets, also see how to build a full driving distance matrix across multiple depots and destinations.

Stop memorizing formulas.
Tell your spreadsheet what to do.

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

Learn more