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

Bulk Geocode a Column of Addresses Into Lat/Lon in a Google Sheet

2026-05-14
5 min read

The Scenario

Your field sales team just handed you a Google Sheet with 400 prospect addresses in column A. The territory-mapping tool you use requires latitude and longitude for each one — it does not accept raw addresses. The addresses were imported from three different CRM exports, which means the formatting is inconsistent: some have full ZIP codes, some have just city and state, and about thirty have international addresses mixed in.

The bad version:

  • Copy a batch of addresses, paste them into the Mapbox Playground one at a time, note the coordinates, and paste them back into columns B and C for each row.
  • Hit an ambiguous address — "100 Main St" with no city — and spend ten minutes trying to figure out which one the CRM meant.
  • Finish three hours later, only to find out the sales team has already added forty more rows to the sheet.

You are not a GIS analyst. Your job is territory planning, not geocoding infrastructure. The report goes to the VP of Sales on Friday and the map tool needs clean coordinate data to render anything useful.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that runs inside your Google Sheet and talks to Mapbox on your behalf. You open the sidebar, describe what you need, and it handles the API calls, response parsing, and writebacks — no scripting required.

For each address in column A, use Mapbox to geocode it and write the latitude into column B, longitude into column C, and place name into column D — flag any unresolved rows in column E with "LOW CONFIDENCE" so I can review them.

What You Get

  • Column B filled with decimal latitude values for each row.
  • Column C filled with decimal longitude values.
  • Column D filled with the Mapbox-resolved place name, so you can visually spot mismatches.
  • Column E left blank for clean geocodes; populated with LOW CONFIDENCE for any row where the match quality score fell below Mapbox's threshold or the address returned a city-level centroid instead of a street match.

What If the Data Is Not Quite Ready

The addresses have inconsistent formatting

Some rows have "123 Main St, Chicago, IL 60601" and others have just "123 Main St Chicago". Mapbox handles this reasonably well, but you want to normalize before running.

Before geocoding, scan column A for addresses that are missing a comma separator between street and city — add a comma where the city name starts — then geocode all rows using Mapbox and write results into columns B, C, and D.

About sixty rows are missing state or ZIP

Geocode all rows in column A using Mapbox. For any row where state and ZIP appear to be missing, attempt geocoding using the city name alone and flag those rows in column E with "CITY ONLY" so I know the precision is lower.

The addresses are split across two tabs

One tab has domestic prospects, another has international accounts, and both need coordinates before you can merge them.

Geocode all addresses in column A of the Domestic tab using Mapbox and write lat, lon, and place name into columns B, C, and D. Do the same for column A of the International tab. Then combine both result sets into a new tab called Geocoded All, preserving the original row data.

The full cleanup-and-geocode pipeline

The data came from a CRM export, has extra whitespace in the address field, mixes apartment numbers into the street line inconsistently, and you need clean coordinates with confidence flags and a sorted output.

Clean column A by trimming whitespace and removing redundant apartment number suffixes that appear after a hyphen. Then geocode each address using Mapbox and write latitude into column B, longitude into column C, place name into column D, and a confidence flag into column E. Finally, sort all rows by column E so LOW CONFIDENCE rows appear at the top for review.

One prompt handles data prep and geocoding in sequence — you do not run cleanup first and geocoding second.

Try It

Get the 7-day free trial of SheetXAI and open the prospect sheet you've been dreading, then ask SheetXAI to geocode column A through Mapbox. If your addresses live across multiple tabs or need cleanup first, say that in the same prompt. You can also explore the sibling article on reverse geocoding GPS coordinates or return to the Mapbox overview for the full list of geographic tasks SheetXAI can handle.

Stop memorizing formulas.
Tell your spreadsheet what to do.

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

Learn more