Neither Excel nor Google Sheets has a built-in county function. The common workaround is a ZIP-to-county lookup table, but 30% of US ZIP codes cross a county line, so that method silently puts some addresses in the wrong county. The reliable way is to geocode each full address to a point and test which county contains it. Our address to county tool does both steps, free, using the Census Bureau's geocoder and county boundaries.
Step by step
- Put the addresses in columns. Use one row per address, with street, city, state and ZIP in separate columns, or one column with the full address. Keep a unique ID column so you can join the results back.
- Save the sheet as CSV. In Excel choose File › Save As › CSV UTF-8. In Google Sheets choose File › Download › Comma-separated values. Split files over 1,000 rows into chunks.
- Upload it to the batch tool. Open the address to county tool, choose the CSV, say whether the first row is a header and run it. A full 1,000 rows usually takes a minute or two.
- Download the results. The download keeps your columns and adds the matched address, match quality, latitude, longitude, county name and five-digit county FIPS code.
- Bring it back into your sheet. Import the CSV with the FIPS column set to Text so leading zeros survive, then join on your ID column with XLOOKUP or VLOOKUP.
- Fix the no-match rows. Correct typos, missing ZIPs or PO boxes and run just those rows again. Rural route and PO box addresses cannot be placed on a map.
Example
A sheet with the columns id, street, city, state, zip and the row 17, 233 S Wacker Dr, Chicago, IL, 60606 comes back with Cook County and FIPS 17031 added, plus the matched address and coordinates.
Keeping FIPS codes intact
A county FIPS code is two state digits plus three county digits. Spreadsheets drop the leading zero from codes like 06037 (Los Angeles County) when they read the column as a number. In Excel, import the CSV through Data › From Text/CSV and set the column to Text, or rebuild it with =TEXT(A2,"00000"). In Google Sheets use =TEXT(A2,"00000") or format the column as plain text before pasting.
When the ZIP code is all you have
If a row has no street address, you can only estimate the county from the ZIP code. Use the county that holds most of the ZIP and mark those rows as approximate. Our state ZIP code maps show where each ZIP sits and which ones straddle county lines.
More than 1,000 rows
Split the file into 1,000-row chunks and run them one after another; each run takes a minute or two. For tens of thousands of rows a day, the Census Bureau's own batch geocoder API is free and has no account requirement. Our tool sends your rows there and adds the county from the returned coordinates.
Uploads are passed to the Census geocoder and not stored. See the privacy page.