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

Find the Best Route4Me Insertion Points for Ad-Hoc Stops Using Excel

The Scenario

You are a same-day courier operations manager. It is 11:30 AM and 20 new pickup requests have come in since morning dispatch. The addresses are in an Excel workbook, column A of the Ad-Hoc tab.

Your drivers are already on routes. You need Route4Me to tell you which existing route each new stop should be inserted into, and where in that route it fits best. The recommendations need to go back into the workbook, best_route_id in column D and estimated extra distance in column E, so dispatchers can approve with one click.

The bad version of this:

  • You open Route4Me's optimization panel for each driver's route
  • You manually test inserting the new address and note the suggested position
  • You do that twenty times, once per pickup
  • You type the route IDs and extra distances into the workbook by hand
  • Two dispatchers are waiting for the recommendations and you are on stop eleven.

The fast version is one prompt.

The Easy Way: One Prompt in SheetXAI

SheetXAI reads each new address and calls Route4Me's optimization API to find the best insertion point, writing the recommendation back to the same row.

Open the SheetXAI sidebar and type:

Take the 20 ad-hoc stops in my Excel sheet, find the optimal insertion route for each using Route4Me, and fill columns D and E with the best_route_id and estimated extra distance.

SheetXAI reads all 20 addresses from the Ad-Hoc tab, queries Route4Me's optimization endpoint for each one, and writes the best_route_id and estimated extra distance back row by row. Dispatchers see all 20 recommendations in the workbook without leaving Excel.

What You Get

A dispatcher-ready insertion plan written into the workbook:

  • Column D — best_route_id from Route4Me for each new stop
  • Column E — estimated extra distance added by the insertion
  • Column F (optional) — suggested insertion position within the route

The recommendations are real optimization outputs. Route4Me factors in current route length, driver proximity, and time windows when suggesting where to insert the stop.

Dispatchers can review the recommendations in the workbook and a second prompt can execute the approved insertions in Route4Me.

What If the Data Is Not Quite Ready

Ad-hoc pickup requests come in messy. SheetXAI handles cleanup and the optimization query in the same prompt.

When the addresses are in combined format

New pickup requests came in as "123 Main St, Chicago, IL 60601" in a single column instead of split fields.

Parse each address in column A of the Ad-Hoc tab into street, city, state, and zip. Then for each parsed address, call Route4Me to find the best insertion route and write the best_route_id and estimated extra distance to columns D and E.

When some requests have time window constraints

A few new stops have a required pickup window in column B as a time range like "1:00 PM - 2:30 PM."

For each new address in column A of the Ad-Hoc tab, call Route4Me to find the best insertion route. Where column B contains a time window, include it as a constraint. Write the best_route_id and estimated extra distance to columns D and E. Flag any stop whose time window cannot be met by any active route in column F.

When you want to limit insertions to routes with fewer than twelve stops

You have a policy that no route should exceed twelve stops.

For each new address in column A of the Ad-Hoc tab, find the best Route4Me insertion route that currently has fewer than 12 stops. Write the best_route_id and current stop count to columns D and E. If no qualifying route exists, write "NO ROUTE AVAILABLE" in column D.

When you need the full chain: parse, filter, find insertion, and execute approved ones in one shot

You want to go from raw pickup requests all the way to executed insertions for any stop where the dispatcher has typed "approve" in column B.

Parse each address in column A of the Ad-Hoc tab into a clean format. For rows where column B is blank, call Route4Me to find the best insertion route and write the best_route_id and estimated extra distance to columns D and E. For rows where column B already says "approve," execute the insertion into the best route and write "inserted" or an error to column F.

The pattern: instead of finding insertion candidates manually, presenting them to dispatchers, and executing approved ones across three separate steps, you describe the full decision loop in one prompt.

Try It

Get the 7-day free trial of SheetXAI and open any Excel workbook with new delivery or pickup addresses, then ask it to find Route4Me insertion points for each one. The Route4Me integration is included in every SheetXAI plan. For full route optimization from scratch, see how to geocode and build an optimized route in Excel or the Route4Me in Excel overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

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

Learn more