ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Text
  3. Standardize Inconsistent Data in Excel: One Spelling Each

Standardize Inconsistent Data in Excel: One Spelling Each

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

To standardize data in Excel, list every spelling with UNIQUE, clean spaces and punctuation with TRIM and SUBSTITUTE, then map each variant to one standard value with a small lookup table and XLOOKUP, such as =XLOOKUP(TRIM(A2),$C$2:$C$6,$D$2:$D$6,TRIM(A2)). Finally, add a drop-down list so new variants can't creep back in.

Key takeaways

  • Inconsistent spellings split your totals: COUNTIF, SUMIF and pivot tables treat NY and New York as different things.
  • SORT(UNIQUE(range)) shows every variant in a column, so you know what to fix.
  • TRIM, CLEAN and SUBSTITUTE remove the invisible differences: extra spaces, line breaks and stray punctuation.
  • A two-column mapping table plus XLOOKUP turns every known variant into one standard spelling.
  • A drop-down list from Data Validation stops people typing new variants.
On this page+
  1. Why inconsistent data breaks your reports
  2. Step 1: List every variant with UNIQUE
  3. Step 2: Remove spaces and invisible characters
  4. Step 3: Fix punctuation and abbreviations with SUBSTITUTE
  5. Step 4: Map every variant to one spelling with XLOOKUP
  6. Step 5: Make capitals consistent
  7. Quick fixes with Find and Replace
  8. Stop new variants with a drop-down list
  9. Practise it

To standardize data in Excel means making every value that refers to the same thing look exactly the same: "NY", "N.Y.", "new york" and "NYC" all become "New York". Until you do, COUNTIF, SUMIF and pivot tables count them as four different cities. This guide shows a repeatable method: find the variants, clean the invisible differences, then map each variant to one spelling with XLOOKUP. It's for anyone who cleans exports, survey answers or customer lists.

Why inconsistent data breaks your reports#

Excel compares text character by character, so any small difference makes a new value. A trailing space, a full stop or an abbreviation is enough. Take this column of cities:

A
1City (raw)
2␣␣NY
3new york
4N.Y.
5Boston
6NYC

(␣ marks a space you can't see in the cell.) Four of the five rows mean New York, but =COUNTIF(A2:A6,"New York") returns 1. Only "new york" matches, because COUNTIF ignores capitals but not spaces, dots or abbreviations. A pivot table would show four separate New York rows.

Step 1: List every variant with UNIQUE#

Before you fix anything, see what you're dealing with. In an empty column, type:

Excel formula
=SORT(UNIQUE(A2:A500))

The result spills a sorted list of every distinct value, so variants sit next to each other: "N.Y.", "new york", "NY", "NYC". UNIQUE and SORT need Microsoft 365 or Excel 2021. In older Excel, click the column's filter arrow (Ctrl+Shift+L turns filters on; Mac: ⌘⇧F): the list shows each value once.

UNIQUE ignores capitals, so "new york" and "New York" appear as one item. Spaces still count, so if you see what looks like the same value twice, one of them probably has a hidden space.

Step 2: Remove spaces and invisible characters#

Many variants are the same word with extra characters around it. Remove those first, so the mapping table in Step 4 stays short.

ProblemFormulaWhat it does
Spaces before, after or doubled=TRIM(A2)Removes extra normal spaces
Line breaks and tabs=CLEAN(A2)Removes non-printing characters
Spaces copied from web pages=TRIM(SUBSTITUTE(A2,CHAR(160)," "))Turns non-breaking spaces into normal ones, then trims

The TRIM function reference covers the details. If TRIM seems to do nothing, the culprit is usually the non-breaking space; the guide to why TRIM isn't working shows how to find it.

Step 3: Fix punctuation and abbreviations with SUBSTITUTE#

SUBSTITUTE replaces one piece of text with another inside a cell. Use it to strip punctuation that creates extra variants:

Excel formula
=SUBSTITUTE(A4,".","")

This turns "N.Y." into NY. Replacing with "" (empty text) simply deletes the character. You can nest SUBSTITUTE to remove several characters at once: =SUBSTITUTE(SUBSTITUTE(A2,".",""),",","") removes dots and commas.

Be careful with whole-word abbreviations. Replacing "St" with "Street" also changes "Stockton" to "Streetockton". For word swaps, use the mapping table in the next step instead. The SUBSTITUTE function reference and the comparison of SUBSTITUTE and REPLACE explain the optional fourth argument, which replaces only one occurrence.

Step 4: Map every variant to one spelling with XLOOKUP#

A mapping table is a small two-column list: each variant on the left, the correct spelling on the right. XLOOKUP then swaps every raw value for its standard version.

CD
1VariantStandard
2NYNew York
3N.Y.New York
4NYCNew York
5New YorkNew York
6BostonBoston

In B2, next to the raw data, type:

Excel formula
=XLOOKUP(TRIM(A2),$C$2:$C$6,$D$2:$D$6,TRIM(A2))

Then fill down to B6. Here's what each part does:

  • TRIM(A2) cleans the value before the lookup, so "␣␣NY" becomes "NY".
  • $C$2:$C$6 is where to look, and $D$2:$D$6 is what to return. The $ signs keep them fixed as you fill down.
  • The last TRIM(A2) is what to return if the value isn't in the table, so new values pass through unchanged instead of showing #N/A.

The result in B2 is New York, and all four New York rows now match. =COUNTIF(B2:B6,"New York") returns 4.

XLOOKUP isn't case-sensitive, so "new york" matches the "New York" row without its own entry. XLOOKUP needs Microsoft 365 or Excel 2021; in older Excel use =IFERROR(VLOOKUP(TRIM(A2),$C$2:$D$6,2,FALSE),TRIM(A2)). The XLOOKUP function reference lists every argument.

To spot values that aren't in the table yet, use "CHECK" as the not-found value instead, then filter column B for CHECK and add the new variants to the mapping table.

When the column looks right, copy it and paste as values (Windows: Ctrl+Alt+V, then V; Mac: ⌃⌘V) over the raw data, so the clean version no longer depends on the formula.

Step 5: Make capitals consistent#

If the only difference is capitals, you don't need a mapping table. PROPER, UPPER and LOWER set the case in one step:

Formula"new YORK" becomes
=PROPER(TRIM(A2))New York
=UPPER(TRIM(A2))NEW YORK
=LOWER(TRIM(A2))new york

PROPER can get names like "McDonald" or "USA" wrong, so check the results. The guide to changing case in Excel covers the exceptions.

Quick fixes with Find and Replace#

For one or two variants, Find and Replace is faster than formulas. Press Ctrl+H (Mac: Control+H), type the variant and the standard spelling, click Options and tick Match entire cell contents. Without that tick, replacing "NY" would also change "SONY" into "SONew York".

Select the column first so the change stays inside it. The guide to Find and Replace tips covers wildcards and the Replace All mistakes to avoid. For a full clean-up checklist, see how to clean messy data in Excel.

Stop new variants with a drop-down list#

Cleaning fixes today's data; a drop-down list protects tomorrow's. Put your standard values in a list, select the entry column and go to Data > Data Validation. Choose Allow: List and point Source at the standard values. Now people pick "New York" from a menu instead of typing their own version.

Practise it#

Standardizing data is a mix of cleaning functions and a lookup, and both get faster with practice. Practise cleaning messy text in a live spreadsheet with TRIM, SUBSTITUTE and PROPER, then practise XLOOKUP to map values to a standard list. Each formula is checked instantly.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Column A has city names typed in different ways. In B2, use XLOOKUP on the trimmed value of A2 to find it in the Variant column (C2:C6) and return its Standard spelling (D2:D6). If it isn't found, return the trimmed value itself.

fx
ABCDE
1
City (raw)
City (clean)
Variant
Standard
2
NY
NY
New York
3
new york
N.Y.
New York
4
N.Y.
NYC
New York
5
Boston
New York
New York
6
NYC
Boston
Boston
7
8
9

Tip: Wrap A2 in TRIM to remove the spaces, then give XLOOKUP the variants, the standard spellings and TRIM(A2) as the not-found value.

Practise this in a lesson

LessonCleaning messy textFix stray spaces, random capitals and inconsistent separators in imported data with TRIM, PROPER, UPPER, LOWER and SUBSTITUTE.LessonXLOOKUPLook up in any direction with XLOOKUP and show a friendly message when nothing matches.Function guideSUBSTITUTESwap or strip characters with Excel's SUBSTITUTE: clean phone numbers, change one occurrence and count characters with LEN. Practice it live.Function guideXLOOKUPXLOOKUP explained with real examples: exact matches, looking left and custom not-found messages, plus a live exercise to try now.Function guideTRIMClean imported data with Excel's TRIM: strip leading, trailing and double spaces so lookups and counts work. Examples and live practice.

Frequently asked questions

How do I make all the same values spelled the same in Excel?

+

Build a small mapping table with each variant in one column and the correct spelling next to it. Then use XLOOKUP to replace every cell with its standard spelling, and paste the results as values.

How do I find all the different spellings in a column?

+

In Microsoft 365 or Excel 2021, use =SORT(UNIQUE(A2:A500)) in an empty column. In older Excel, open the column's filter arrow, which lists each distinct value once.

Is XLOOKUP case-sensitive when standardizing data?

+

No. XLOOKUP treats new york and New York as the same, so one mapping row covers every capitalization. If capitals matter, fix them separately with PROPER or UPPER.

Can I standardize data without formulas?

+

Yes, for a few fixes. Use Find and Replace (Ctrl+H) with Match entire cell contents ticked, so replacing NY doesn't also change words that contain NY. For many variants, a mapping table is safer.

How do I stop inconsistent data being entered?

+

Use Data > Data Validation > List and point it at your list of standard values. People then pick from a drop-down instead of typing, so every entry is spelled the same way.

Sources

  • XLOOKUP function - Microsoft Support
  • SUBSTITUTE function - Microsoft Support
  • TRIM function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Why inconsistent data breaks your reports
  2. Step 1: List every variant with UNIQUE
  3. Step 2: Remove spaces and invisible characters
  4. Step 3: Fix punctuation and abbreviations with SUBSTITUTE
  5. Step 4: Map every variant to one spelling with XLOOKUP
  6. Step 5: Make capitals consistent
  7. Quick fixes with Find and Replace
  8. Stop new variants with a drop-down list
  9. Practise it

Keep reading

Text· 7 min read

Clean Messy Data in Excel With TRIM, CLEAN and PROPER

Use TRIM to remove extra spaces, CLEAN to remove hidden non-printing characters, and PROPER to put a capital at the start of each word. Nest them to fix several problems at once: =PROPER(TRIM(A2)) turns " maria gonzalez" into "Maria Gonzalez". Build the clean version in a new column, check it, then paste it as values.

Text· 5 min read

Change Case in Excel: UPPER, LOWER and PROPER

Excel has no Change Case button, so you use a formula in a helper column: =UPPER(A2) for capitals, =LOWER(A2) for small letters, and =PROPER(A2) to capitalise each word. Then copy the results and paste them back as values to replace the original text. Flash Fill is a quick alternative for simple lists.

Basics· 5 min read

Find and Replace in Excel (Ctrl+H) Tips

To find and replace in Excel, press Ctrl+H (Mac: Control+H), type the text to find and its replacement, then click Replace All. Select a range first to limit the change to it. Click Options to match case, match entire cell contents or search the whole workbook. Press Ctrl+Z straight away if the result is wrong.

More on text

  • SUBSTITUTE and REPLACE in Excel
  • The TEXT Function: Format Numbers and Dates Inside Text
  • TEXTBEFORE and TEXTAFTER in Excel
  • TEXTJOIN in Excel: Join a List and Skip Blanks
  • TEXTSPLIT in Excel: Split Text Into Columns
  • TRIM Not Working in Excel? Non-Breaking Spaces Explained
All text articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free