New Tool Radar

AI for Data & Spreadsheets

How to Standardise Country Names in a CSV in Google Sheets

Standardise country names in a CSV in Google Sheets so UK, U.K. and United Kingdom count as one country.

Schematic illustration for How to Standardise Country Names in a CSV in Google Sheets: three numbered steps - List unique country values; Replace each variant; Add a dropdown rule.

A country written as UK, U.K. and United Kingdom is three countries to a filter, so a total by country will be wrong three ways. Listing the unique values, replacing each variant with one name, and locking the column with a dropdown stops the problem coming back.

Prerequisites

  • Google Sheets
  • The CSV imported into Sheets
  • A copy of the source file, so the original stays untouched.

Steps

  1. Select the country column and use UNIQUE on a copy to list every spelling in use.
  2. Choose one spelling per country, such as United Kingdom, and write the list down.
  3. Use Find and Replace on each variant, replacing it with the chosen spelling.
  4. Add a data validation dropdown to the country column with the final list of names.
  5. Build a summary with COUNTIF per country and check the counts add to the row total.

Worked example: Fictional orders by country after standardising

The practice table below is a fictional five-order list after standardising. The count column is 1 per order, and the total is the number of orders. The table below is fictional practice material, with fictional values. It is the expected result, worked out by hand, not a run of any tool.

Country Count
United Kingdom 1
United Kingdom 1
France 1
Germany 1
United Kingdom 1
Total 5

Expected result. Three countries only, the United Kingdom counted three times, and the count is 5.

Limits

  • Find and Replace can change text inside other words, so check the match-whole-cell setting where it matters.
  • A dropdown stops new variants but does not fix the rows already typed, so clean first and lock second.

Sources

See all