How to Remove Text, Spaces and Characters From Excel Cells
In this article
Use Find and Replace (Ctrl+H on Windows) to strip unwanted text from cells: type the text you want gone in the "Find what" box, leave "Replace with" empty, and click Replace All. For spaces, extra characters, or only part of a cell's contents, use the formulas below.
Time 2 min · Steps 8 · Level Easy
Remove Unwanted Text With Find and Replace
- Save your workbook first so you can close without saving if the replace goes wrong.
- Select the cells to clean — drag over a range, a column, or click a single cell to act on the whole sheet.
- Open Find and Replace with Ctrl+H on Windows, or Home > Find & Select > Replace (labels can differ slightly by version).
- Type the text to remove in the "Find what" box — for a space, press the spacebar once.
- Leave "Replace with" empty so Excel deletes the text rather than swapping it for something else.
- Click Options and set the match — tick "Match entire cell contents" only when you want to clear whole cells, not partial text.
- Click Replace All and read the confirmation message, which tells you how many replacements Excel made.
- Check the result — if it removed too much, press Ctrl+Z to undo and try again with a more specific search term.
Decide Between Find and Replace and a Formula
Find and Replace changes your data permanently, which is fine when you are sure of the edit. Use a formula instead when you want to keep the original column untouched, or when the text you want gone sits in a different position in each cell. Formulas also let you remove a fixed number of characters from the left or right of every cell at once, which Find and Replace cannot do.
Strip characters from one end of a cell
Put your text in A1 and use one of these, then fill the formula down:
- First N characters: =RIGHT(A1, LEN(A1)-3) removes the first 3 characters; change 3 to any count.
- Last N characters: =LEFT(A1, LEN(A1)-2) removes the last 2 characters.
- All spaces: =SUBSTITUTE(A1," ","") — the middle argument is one space, the last is empty.
- One specific word: =SUBSTITUTE(A1,"kg","") removes every "kg" in the cell.
- Text after a symbol: =LEFT(A1, FIND("-",A1)-1) keeps only what comes before the first hyphen.
Formulas return results in a new column. Once they look right, select that column, copy it, then use Paste Special > Values over the original column so the text replaces the formulas. Delete the helper column afterwards.
Remove Line Breaks, Apostrophes and Hidden Characters
Line breaks typed inside a cell (Alt+Enter) do not respond to typing a space in Find and Replace. In the "Find what" box, hold Ctrl and press J — this inserts the line-break character, which is invisible but works. Leave "Replace with" empty to delete breaks, or put a single space to join the lines with a space between them.
A leading apostrophe forces Excel to treat a number as text, and it hides itself in the cell. The fastest fix is the error marker: select the cells, click the small warning diamond that appears, and choose Convert to Number. If no diamond appears, =VALUE(A1) in a helper column converts text-formatted numbers into real numbers.
Non-breaking spaces, common in text copied from web pages, look identical to normal spaces but are a different character. =SUBSTITUTE(A1, CHAR(160), " ") swaps them for regular spaces, and you can then remove those with the space method above.
Symptoms, Causes and Fixes for Cells That Will Not Clean
| Symptom | Likely cause | Fix |
|---|---|---|
| Find and Replace finds nothing | Extra spaces around the text, or Match entire cell contents is ticked | Untick the option, or search for the text without surrounding spaces |
| Numbers stay left-aligned after cleaning | Cells are formatted as Text | Select them, set the format to General or Number, then use Convert to Number |
| Formula shows in the cell instead of the result | The cell is formatted as Text | Change the format to General, then double-click the cell and press Enter |
| Trailing spaces survive the space replace | They are non-breaking spaces (character 160) | Use =SUBSTITUTE(A1, CHAR(160), " ") first, then remove normal spaces |
| Replace All changed cells you wanted left alone | The whole sheet was selected | Press Ctrl+Z, then select only the target range before replacing |
| Leading zeros vanish from codes | Excel reads them as numbers | Format the cells as Text before pasting, or re-enter codes with a leading apostrophe |
Check the Result Before You Rely On It
After any removal, spot-check the shortest and longest entries in the column, because those are where over-trimming shows first. Use =LEN(A1) in a spare cell to count characters — if a code should be 10 characters long and some cells now show 8, something was cut that should have stayed. Sorting the column A to Z also clusters similar entries together so oddities stand out. When totals or lookups behave differently after cleaning, the usual culprit is a stray space or a text-formatted number, both covered in the table above.
Official source: Microsoft Support