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

Look Up Google Country Codes for a Target Market List in a Google Sheet

2026-05-14
5 min read

The Scenario

Your SEO lead left the team six weeks ago. They were midway through a localized rank-tracking project — twenty target countries, each needing geo-specific SERP queries. The handoff notes say "use the Google country codes in the Markets tab." The Markets tab has country names. No codes. No documentation about where the codes came from or how to look them up.

You've inherited the project and the quarterly review is in two weeks.

The bad version:

  • Google "Google Search country codes," find a blog post with a partial list, manually match each of the twenty country names to a code, wonder if the list is still current
  • Cross-reference with the Autom API docs, notice three countries on your list aren't in the blog post, spend 20 minutes tracking down the edge cases
  • Paste the codes into the sheet one by one, misspell "Netherlands" as "Netherland" in the function call, get a silent API error on three rows

The quarterly review has a slide for "localized SERP coverage." Right now that slide has nothing on it.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Google Sheet. It reads the country names in your sheet, calls Autom's country code lookup endpoint for each one, and writes the resolved codes directly into the adjacent column. You don't touch the API docs.

For each country name in column A of the "Markets" tab, use Autom to look up the Google-supported country code and write it into column B. If a country name returns no match, write "not found" in column B.

What You Get

  • Column B populated with the correct Google country code for each row in column A
  • "Not found" written into column B for any country name Autom does not recognize, rather than leaving the cell blank
  • No silent failures — every row in column A gets a result or an explicit flag

What If the Data Is Not Quite Ready

Country names are written inconsistently — "US," "U.S.," "United States," and "USA" all appear

Before calling Autom, normalize each value in column A to its full English country name (e.g., "US" → "United States"). Then use Autom to look up the Google country code for each normalized name and write it into column B.

The sheet has a mix of country names and region names that shouldn't be included

For each row in column A of the "Markets" tab, skip any value that appears to be a region or continent (e.g., "APAC," "EMEA," "Latin America"). For country names, use Autom to look up the Google country code and write it into column B. Write "skipped — not a country" in column B for the excluded rows.

Country codes need to be joined with a second tab that has the campaign budget per market

Use Autom to look up the Google country code for each country name in column A of "Markets" and write it into column B. Then join with the "Budgets" tab on the country name column and write the corresponding budget value into column C.

Full audit-plus-fill in one shot

Column A in the "Markets" tab has country names, some of which are inconsistently formatted ("UK," "United Kingdom," and "Britain" all appear). Normalize them to standard full English country names. Use Autom to look up the Google country code for each. Write the normalized country name into column A (overwrite), the country code into column B, and flag any row where normalization was ambiguous into column C with "review."

One prompt handles the normalization, the lookup, and the audit flag — no intermediate cleanup pass needed.

Try It

Open any sheet with a market list and get the 7-day free trial of SheetXAI — then ask it to resolve your country names to Google country codes via Autom. Also see: resolving city and region names to location codes and the Autom hub overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

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

Learn more