ExtractCity finds and extracts city names from any cell in Google Sheets.
Call ExtractCity over a range of address data like this:
=EXTRACTCITY(A1:A10)
And it will output the city name from each cell.
EXTRACTCITY outputs a standardized city name from any text or address input.
The add-on automatically detects city names within messy or formatted address strings — no API keys, no setup, and no external lookups required. It works seamlessly across individual cells or full column ranges.
You can also call ExtractCity with an optional second argument of 1, and the output will include the complete city, state / province, and country (when available).
For example, if cell A1 contains:
123 Main St Chicago IL
and you call:
=EXTRACTCITY(A1, 1)
It will output:
Chicago, IL United States
Normalize and categorize address or location data
Extract cities from freeform text in Sheets
Clean CRM or contact lists for analytics
Prepare real estate or eCommerce datasets
Standardize city data for map plotting
De-duplicate and merge datasets by city
ExtractCity does not perform geocoding; it simply identifies and outputs clean city information, making it a fast, privacy-safe alternative to traditional location APIs.
ExtractCity supports thousands of cities worldwide, from major metropolitan areas to smaller towns. If ExtractCity doesn’t yet recognize a specific city, you can suggest it via the Support link at the bottom of this page.
* Google services impose daily quotas and hard limitations on some features - https://developers.google.com/apps-script/guides/services/quotas
Extract City Lookup use and transfer of information received from Google APIs to any other app will adhere to Workspace API User Data and Developer Policy, including the Limited use of user data.