Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Formula No Special Characters: Clean Text Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To strip special characters from text in an Excel formula, combine SUBSTITUTE for known characters with TEXTJOIN, MID and SEQUENCE (or a helper column) to keep only letters and digits. For a quick one-off cleanup you can use Find and Replace or Power Query instead of a formula. The formula route is the one that stays live: edit the source cell and the cleaned version updates automatically.

"Special characters" usually means punctuation, symbols, spaces, non-printing characters, or accented letters. Excel has no single built-in function called "remove special characters", so you build the result from a few functions. Which functions are available depends on your Excel version: TEXTJOIN, SEQUENCE and LET require Microsoft 365 or Excel 2021 and later. Older versions need a helper column or a short macro.

What You'll Need

  • A worksheet containing the text you want to clean, ideally in one column with no merged cells.
  • Excel 2021, Microsoft 365, or newer for the dynamic array formulas. Excel 2019 and earlier need the substitute-only or helper-column approach.
  • An empty column next to your data for the formula (or an empty area if you plan to paste values back).
  • A clear definition of what "special" means for your data: strip everything except A-Z and 0-9, or only remove specific characters like # and &?

Step-by-Step

  1. Back up or copy the sheet first. Select the affected column, copy it, and paste it into a spare sheet. Formulas that overwrite originals are easy to get wrong, and having the original text lets you compare results.
  2. Decide your target character set. Write down exactly what must survive. Common choices are letters and digits only (for SKUs, phone numbers, usernames) or letters, digits, spaces and hyphens (for addresses and names). This decision changes the formula, so make it before you start typing.
  3. Try the fastest route: Find and Replace. Select the column, press Ctrl+H (Windows) or Cmd+H (Mac). Type the character to remove in "Find what", leave "Replace with" blank, and click Replace All. Repeat per character. This is best for a one-time cleanup and for characters you can type easily.
  4. Use SUBSTITUTE for a short, known list. In the first empty cell next to your data, type a nested formula such as =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"#",""),"&",""),"-",""). Each additional character adds one more SUBSTITUTE( wrapper around the previous result. Copy it down the column. This works in every Excel version but gets unwieldy past about ten characters.
  5. Use the keep-only approach for letters and digits. In Microsoft 365 or Excel 2021, enter this in B2 and fill down: =TEXTJOIN("",TRUE,IFERROR(MID(A2,SEQUENCE(LEN(A2)),1)*1,"")) for digits only, or =LET(t,A2,TEXTJOIN("",TRUE,IF(ISNUMBER(SEARCH(MID(t,SEQUENCE(LEN(t)),1),"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")),MID(t,SEQUENCE(LEN(t)),1),""))) for letters and digits. The formula walks each character, tests it, and joins the survivors.
  6. Handle accented letters deliberately. The keep-only formula above drops letters like e, a and o with accents because they are not in the allowed list. If you want to keep them, add them to the allowed string, or remove accents separately before cleaning. If your goal is plain ASCII, drop them and note the change.
  7. Remove non-printing characters. Line breaks and tabs survive SUBSTITUTE on printable characters only. Use =CLEAN(A2) to remove the first 32 non-printing characters, or =SUBSTITUTE(A2,CHAR(160)," ") for a non-breaking space copied from a web page. Stack CLEAN and your main formula in either order you prefer.
  8. Convert the result to values. Once the cleaned column looks right, select it, press Ctrl+C, then Home > Paste > Values (or right-click and choose the Values icon). This removes the formulas so you can delete the original column without breaking anything.
  9. Verify a sample. Compare five or ten rows side by side with the originals. Check the longest strings, entries with symbols in the middle, empty cells and cells containing only spaces. Empty cells should return blank rather than an error.

Common Mistakes

Replacing into the source column. If you write the formula in A2 referring to A2, Excel flags a circular reference. Always put the formula in a neighbouring column and copy the result back afterwards.

Forgetting that SUBSTITUTE is case-sensitive in its find text. SUBSTITUTE matches the exact text you supply, so replacing "x" leaves "X" untouched. If case does not matter, this rarely bites, but it matters when removing a specific letter.

Assuming TEXTJOIN is available everywhere. In Excel 2019 and earlier, TEXTJOIN and SEQUENCE return #NAME?. Fall back to nested SUBSTITUTE or Power Query rather than assuming the formula is wrong.

Overwriting numbers with text. If your cleaned result must be used for VLOOKUP against a numeric key, a text-formatted number will not match. Wrap the result in VALUE() when the output is purely numeric.

Deleting the helper column too early. If you delete the column the formula references before pasting values, every cell shows #REF!. Paste values first.

Tips

  • Use Data > Text to Columns when the problem is delimiters rather than stray symbols; it splits cleanly by comma, semicolon or fixed width.
  • For recurring imports, load the data through Data > Get Data into Power Query and apply a "Replace Values" step. The cleanup then reruns on every refresh, with no fragile formulas to maintain.
  • Name the allowed characters in a cell (for example, a short list in Z1) and reference it in the formula instead of hard-coding a long string. It makes the rule auditable and easy to change.
  • Test on a copy with accented text, emoji and symbols before running on thousands of rows; emoji are multi-character in Excel's text functions and can produce odd partial results.
  • Wrap results in TRIM if removing characters leaves double spaces, which breaks matching and lookups.

Troubleshooting

The formula returns #VALUE!. Usually a mismatched quotation mark or parenthesis in a long nested formula. Build it up in stages instead of one giant string.

Characters remain that you expected to go. Check whether the character is a lookalike: a curly apostrophe instead of a straight one, or a non-breaking space instead of a normal space. Copy the actual character from the cell into the SUBSTITUTE argument rather than retyping it from the keyboard.

The result is empty for every row. Your allowed-character string is probably wrong or the reference is off by a row. Test the innermost MID on a single character first.

Spill errors in Microsoft 365. If you see #SPILL!, the output range is blocked by existing content. Clear the cells below the formula or move the formula to an empty area.

Numbers stop matching after cleaning. The output is text. Convert it with VALUE or by multiplying by 1 where a real number is needed.

Frequently Asked Questions

Is there a single Excel function that removes all special characters?

No. Excel provides SUBSTITUTE, CLEAN, TRIM and the text functions, but no dedicated "remove special characters" function. You combine them, or use Find and Replace or Power Query.

Why does SUBSTITUTE not remove a space that looks normal?

It is probably a non-breaking space (CHAR(160)) rather than a regular space. Remove it with SUBSTITUTE(A2,CHAR(160)," ") before running TRIM.

Can I keep accented letters when stripping symbols?

Yes, but only if you add them explicitly to the allowed-character list in a keep-only formula. A simple A-Z and 0-9 filter will drop them.

Do these formulas work in Excel for the web and Excel for Mac?

SUBSTITUTE, CLEAN, TRIM and MID work across Excel for the web, Mac and Windows. TEXTJOIN and SEQUENCE require a version that supports them; check whether the function returns #NAME? as a quick test.

Will cleaning the text change my original data?

Not unless you overwrite it. Formulas in a separate column leave the source untouched; only Find and Replace or pasting values over the source changes the original text.