To edit and replace text in Excel, use Find and Replace: press Ctrl+H on Windows or Command+H on a Mac, type what you want to find in the "Find what" box, type the replacement in "Replace with", then click "Replace All" to change every match at once or "Replace" to step through matches one by one. For formula-level substitution of part of a text string, use the SUBSTITUTE function in the cell itself. The exact dialog labels can differ slightly by Excel version, device or region, but the shortcut and the two boxes are consistent.
What You'll Need
- Excel on Windows, macOS, or Excel for the web (the web version has the same Find and Replace dialog via Ctrl+H).
- The sheet you want to change, ideally saved or backed up first (Ctrl+S, or File > Save a Copy).
- Optionally a helper column if you want to preview changes before overwriting your data.
Step-by-Step
- Save a copy first. Press Ctrl+S to save, or use File > Save a Copy to keep an untouched version. Find and Replace has no undo history of its own; a wrong "Replace All" can only be reversed with Ctrl+Z, and only in the current session. If you close the file without saving, changes are lost; if you save them, the original is gone.
- Select the range you want to affect (or don't). If you highlight a block of cells first, Excel limits the search to that block. If nothing is selected, Excel searches the whole sheet. To be offered the whole workbook, click "Options" in the dialog and set "Within" to "Workbook".
- Open the dialog. Press Ctrl+H (Windows) or Command+H (Mac). Alternatively go to Home > Editing > Find & Select > Replace. Note that Command+H on Mac is also the system Hide shortcut in some contexts; if the dialog does not appear, use the Home tab menu instead.
- Fill in "Find what". Type the text exactly as it appears. Case matters only if you turn on "Match case", so by default "Blue" and "blue" are both matched.
- Fill in "Replace with". Type the new text. Leave it empty if you want to delete the matches entirely.
- Set the options you need. Click "Options" to expand the panel and choose "Match case", "Match entire cell contents" (only replaces cells whose whole value equals your search term), "Match entire cell contents" toggles, and the search direction ("By Rows" or "By Columns"). "Look in" lets you choose "Formulas" (searches the formula text), "Values" (searches displayed results), or "Comments".
- Preview with "Find All". Click "Find All" before replacing anything. Excel lists every matching cell below the dialog and shows the count. Click a row in that list to jump to the cell. If the count is far higher than expected, tighten your search term or turn on "Match entire cell contents".
- Replace everything at once, or one at a time. Click "Replace All" to commit every match; Excel reports how many replacements it made. Or click "Find Next" to move to the first match, then "Replace" to change that one and move on, leaving the ones you want intact.
- Check the result. Scroll through the affected areas. If the result is wrong, press Ctrl+Z immediately (Command+Z on Mac) and repeat from step 7 with a more precise search.
- For partial text inside strings, use SUBSTITUTE. In a helper column, enter =SUBSTITUTE(A2,"old","new") to replace within the text of A2. Add a fourth argument to limit how many occurrences are replaced: =SUBSTITUTE(A2,"old","new",1) changes only the first. Copy the formula down, then copy the results and paste as values over the original column if you want to keep them.
- For wholesale cell replacement with multiple pairs, use formula chains. Nested SUBSTITUTE calls, e.g. =SUBSTITUTE(SUBSTITUTE(A2,"NYC","New York"),"LA","Los Angeles"), handle several corrections in one pass without relying on the dialog.
- Handle wildcards deliberately. In the dialog, ? matches any single character and * matches any run of characters. To search for a literal ? or *, type ~? or ~*. Wildcards do not work in SUBSTITUTE, so keep that function for literal text only.
Common Mistakes
- Replacing a short string that appears inside longer ones. Replacing "cat" also changes "category" and "concatenate". Use "Match entire cell contents" or search for longer, unambiguous text.
- Assuming it only touched the visible range. If nothing was selected, the search covers the whole sheet, including cells scrolled far out of view.
- Forgetting that formatting is not part of the find. Find and Replace works on content, not on fill colour, font or bold. Use Home > Find & Select > Go To Special > Format or conditional formatting for those.
- Failing to notice it skipped formulas. "Look in: Formulas" searches the formula string, not the result. Searching for a number that appears only as a calculated value will miss it unless "Look in" is set to "Values".
- Using Replace to fix numbers stored as text only partly. Replacing "1,000" with "1000" in cells flagged as text may leave them as text; use Text to Columns or VALUE() afterwards to convert.
- Relying on undo after closing. Ctrl+Z only works in the open session and only for the last actions. After save-and-close, the change is permanent.
Tips
- Press Ctrl+F for a plain search without replacing; it uses the same dialog with the Replace tab hidden.
- Use "Find All" with an empty "Replace with" to count how many cells contain a term before deleting it.
- To replace text in formulas only, set "Look in: Formulas" and search for a function name such as VLOOKUP; Excel edits the formula text, not the computed values.
- For repeated clean-up work, WRAP SUBSTITUTE, TRIM and PROPER together: =PROPER(TRIM(SUBSTITUTE(A2," "," "))) tidies spacing and capitalisation in one helper column.
- Use "Match entire cell contents" when you are correcting a value such as "Q1" to "Quarter 1" without disturbing "Q10" or "HQ1".
- Keep a backup copy of the workbook whenever you run "Replace All" across a whole workbook containing several sheets.
Troubleshooting
The dialog finds nothing. Check the "Look in" setting (Formulas vs Values vs Comments), check that "Match entire cell contents" is not on, and check whether only a small range is selected. Clear the selection to search the whole sheet.
It replaced too much. Press Ctrl+Z straight away. Reopen the dialog, turn on "Match entire cell contents" or use a longer search string, and use "Find All" to confirm the count first.
The replacement broke formulas. If a formula's text contained the search term, the formula itself was edited. Undo, then restrict the search to a helper column of values and copy the cleaned values back over the formulas where appropriate.
Replace All reports fewer matches than expected. Cells that differ by case, hidden rows, filtered-out rows, or text split across several cells will not match. Clear filters, and turn off "Match case" unless you want it.
The result is still text, not a number. Find and Replace keeps the cell's existing format. Convert with Home > Number Format, Text to Columns, or multiply by 1 in a helper cell.
The shortcut does nothing. Another add-in or system shortcut may be intercepting it. Use the Home tab > Find & Select menu instead, and check Excel's options for conflicting keyboard shortcuts.
Frequently Asked Questions
Does Find and Replace work across multiple sheets at once?
Yes, if you click "Options" and set "Within" to "Workbook". Otherwise it searches only the active sheet, and only a selected range if one is highlighted.
Can I replace text inside formulas without changing the values?
Yes. Set "Look in: Formulas" and Excel searches the formula text, so you can rename a sheet reference or a function across many cells at once.
Why did my wildcard search not find anything?
Wildcards (? and *) only apply in the dialog, not in SUBSTITUTE. Escape a literal wildcard with a tilde (~) if you want to match it exactly.
Can I replace only within part of a cell?
Not with the dialog, since it replaces whole cell contents. Use SUBSTITUTE in a helper column to change only the matching portion of a string.
Is there a limit to how many replacements I can do?
There is no fixed count in the dialog; it replaces every match in the search scope. Extremely large workbooks may take a moment, so save first.
Does Ctrl+Z undo a Replace All after saving?
No. Undo applies only to the current unsaved editing session. Once you save and close the workbook, the change is final, which is why a backup copy matters.