To replace text in Excel, use Find and Replace: press Ctrl+H on Windows (or Command+H on Mac), type what you want to find in the Find what box, type the replacement in the Replace with box, then click Replace All or Replace one at a time. This changes cell contents across the sheet or workbook without retyping anything. You can also replace formatting, replace within formulas, and use wildcards for pattern matching. Nothing needs to be installed first, but it helps to save a copy of your file before a large replace operation.
What You'll Need
- Microsoft Excel on Windows or Mac (Excel for the web works too, with a slightly different menu path)
- A workbook open with the data you want to edit
- Optional: a backup copy of the file before making bulk changes
Step-by-Step
- Select the range you want to search. If you want to replace across the entire sheet, click any single cell. If you want to limit the change to a specific block, highlight that range first. Find and Replace searches the active sheet by default; to search the whole workbook, choose Options in the dialog and set Within to Workbook.
- Open Find and Replace. Press Ctrl+H (Windows) or Command+H (Mac). Alternatively, go to the Home tab, click Find & Select in the Editing group, then choose Replace. In Excel for the web, the same Find & Select menu is on the Home tab; labels can differ slightly by version, device or region.
- Enter the search term. In the Find what box, type the exact text, number, or formula fragment you want to locate. Matching is not case-sensitive by default; tick Match case under Options if case matters.
- Enter the replacement. In the Replace with box, type the new text. Leave it blank to delete the found text entirely.
- Set options if needed. Click Options to expand the dialog. Match entire cell contents limits matches to cells whose whole value equals the search term, which prevents partial replacements inside longer strings. Within controls sheet vs. workbook. Search controls whether Excel looks by rows or by columns.
- Use Replace or Replace All. Click Replace to step through matches one at a time and confirm each change; Excel highlights the found cell and moves to the next match when you click Replace again. Click Replace All to change every match at once. Excel reports how many replacements were made.
- Close the dialog and verify. Click Close and check a few changed cells. If the result is wrong, press Ctrl+Z (or Command+Z) immediately to undo the replacement. Undo works on the last replace operation as a single action.
- Save the workbook. Press Ctrl+S (or Command+S) to keep the changes.
Common Mistakes
- Replacing across the whole workbook unintentionally. The default is the active sheet only. If you set Within to Workbook and forget, other sheets change too. Undo may not restore everything if you have already saved.
- Partial matches inside longer words. Searching for "cat" will also hit "category" and "concatenate". Use Match entire cell contents or wildcards to narrow the match.
- Replacing in formulas without meaning to. Find and Replace searches formulas as well as values. If you replace a number that appears inside a formula, the formula changes. Switch to Formulas view first if you want to inspect what will change.
- Forgetting case sensitivity. By default "Apple" and "apple" both match. Tick Match case when capitalization matters.
- Not backing up before Replace All. A bulk replace can be hard to reverse after saving. Save a copy first.
Tips
- Use wildcards under Options: ? matches any single character, * matches any number of characters, and ~ escapes a literal ? or *. For example, find
Sm?thto match Smith and Smyth. - Replace formatting as well as text: click Format in the dialog to set the format to find or the format to apply. This is useful for restyling cells that contain specific text.
- To replace only within a selection, highlight the range before opening the dialog; Excel then searches that range.
- Use Find All first to preview how many matches exist before committing to Replace All.
- If you need to replace line breaks, type Ctrl+J in the Find what box (Windows) to represent a line break.
Troubleshooting
- No replacements made. Check that the search term is spelled exactly as it appears, that the correct sheet is active, and that Within is set to the scope you expect. If Match entire cell contents is ticked, partial matches will not be found.
- Replace All changed too much. Press Ctrl+Z immediately. If you have already saved, close without saving and reopen the file, or restore from a backup or version history if available.
- Find and Replace is greyed out or unresponsive. The sheet may be protected. Go to the Review tab and check Unprotect Sheet if you have the password. Shared workbooks can also restrict some editing.
- Formulas show errors after replacing. Undo the change and check which formulas contained the replaced text. Replace only values, not formula fragments, or edit the formulas directly.
- Wildcards not working. Make sure Use wildcards is ticked under Options. If you want to search for a literal asterisk or question mark, precede it with a tilde (~).
Frequently Asked Questions
Does Find and Replace work across multiple sheets at once?
Yes, if you set Within to Workbook in the Options section of the dialog. Otherwise it searches only the active sheet.
Can I replace text inside formulas?
Yes. Find and Replace searches formula text as well as displayed values. Be careful, because changing part of a formula can break it; undo with Ctrl+Z if needed.
Is Find and Replace case-sensitive?
Not by default. Tick Match case under Options to make it case-sensitive.
Can I replace formatting, not just text?
Yes. Use the Format button in the dialog to specify the format to find and the format to replace it with.
Why did Replace All say 0 replacements when I can see the text?
Common causes: the text is in a different sheet, Match entire cell contents is on, the cell is formatted as text and the search term is a number, or there are leading/trailing spaces. Try searching for a shorter fragment.
Can I undo a Replace All after saving?
No, once saved the change is permanent unless you have version history or a backup. Always save a copy before a large replace operation.