Skip to content
mentoor

Topic 3 of 5 · 4 min read

Standardizing names, dates and addresses

Goal: Specify a target format for each column and get ambiguous values flagged for review instead of silently guessed.

To clean a messy column, define exactly one target format for it, and tell the model to flag any value it cannot convert with certainty. Cleaning is not guessing. A model that guesses quietly makes your data wrong in a way that looks neat.

Check yourself · 1 of 3

A column holds 03/04/25 and the source gives no clue about the country. What should the cleaning step do?

Choose one answer

Why it matters

Real lists are untidy. One column holds "3 Jan 2025", "01/03/25" and "2025-01-03". Names appear as "J. Smith", "John Smith" and "Smith, John". Prices come in dollars, euros and "12k". You cannot sort, count or merge a column like that. A chat model can fix hundreds of rows in one go. The danger is the rows where the right answer is not clear.

How to do it

  1. Write the target for each column. Dates as YYYY-MM-DD. Names as First Last, in title case. Phone numbers with country code. Amounts as plain numbers in one currency. This is the standard that ISO 8601 gives for dates, and it cannot be misread.
  2. Name the ambiguity rules. Say what "03/04/25" means in this file, or say that it must be flagged. If you do not know the rule, the model does not either.
  3. Add a status column. Ask for OK, CHANGED or REVIEW next to each row. REVIEW means the model was not sure.
  4. Keep the original. Return the raw value beside the cleaned one, so a person can compare.
  5. Use a tool for matching. For name variants, a tool such as OpenRefine groups similar spellings and lets you decide. A model can also suggest groups, but you approve them.

Before and after

Before: Clean up this list of dates.

The model will pick a format. For 03/04/25 it will choose March 4 or April 3, and it will not tell you it chose.

After: Convert each date in column A to YYYY-MM-DD. This file comes from a UK supplier, so 03/04/25 means 3 April 2025. If the day and month are both 12 or less and the source does not show the order, write REVIEW. Return the original, the cleaned value and a status in three columns.

What goes wrong

  • Swapped day and month. Any date with both numbers 12 or below can be read two ways. One wrong guess can move an invoice to the wrong month.
  • Merged people. "J. Smith" in Leeds and "J. Smith" in Boston become one customer.
  • Lost units. "12k" turns into 12 when it should be 12,000, or a weight in pounds is treated as kilograms.
  • Over-correction. Real names such as "McDonald" or "de la Cruz" get changed to a standard spelling.
  • Hidden changes. Without the original column, nobody can see what the model altered.

Examples

03/04/25

A list from a UK supplier and a list from a US supplier are merged. The model converts every 03/04/25 to 2025-04-03. For the US rows, that date was 4 March. Fixing it means telling the model which supplier uses which order, or asking for REVIEW on the ambiguous rows.

Three Smiths

A customer list has "J. Smith", "John Smith" and "Smith, J.". Merging all three into one customer is tempting. The addresses show two different cities. The right result is two customers and one group flagged REVIEW, not one tidy record.

Key points

  • Define one target format per column before you ask for cleanup.
  • Dates with both numbers at 12 or below are ambiguous; state the file's rule or ask for a REVIEW flag.
  • Add a status column and keep the original value so every change can be checked.
  • Name variants should be grouped by a tool or a model, then approved by a person.
  • Units and currencies need explicit conversion rules, including which rate and which date.

Common mistakes

  • Asking for "a consistent format" without naming it.
  • Letting the model resolve 03/04 without knowing which country wrote it.
  • Cleaning in place and losing the original values.
  • Merging name variants without checking a second field such as city or email.

Check yourself · 2 of 3

You ask a model to clean a column of customer names. What is the most useful extra column to request?

Choose one answer

Check yourself · 3 of 3

Two rows read "J. Smith, Leeds" and "John Smith, Boston". What should a careful cleanup do?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic