The Find and Replace feature in Excel lets you search for text or numbers and swap them out across your entire spreadsheet in one action
Excel's Find and Replace tool saves time when you need to change the same word, number, or phrase in many cells at once. Instead of clicking into each cell and editing by hand, you can search for what you want to change and replace it everywhere it appears — or only in the cells you choose.
The feature works the same way in Excel on Windows, Mac, and the web version. You can replace exact matches, partial text within cells, or use wildcards and special characters to find patterns. You can also limit your search to specific columns, sheets, or just the cells you have selected.
Key Takeaways
- Open Find and Replace by pressing Ctrl+H on Windows or Command+Option+F on Mac, then type what you want to find and what you want to replace it with.
- Click "Replace All" to change every match at once, or "Replace" to change them one at a time and skip any you want to keep.
- Use "Match entire cell contents" if you want to replace only cells that contain exactly that text, not partial matches within cells.
- You can search within a single sheet, all sheets, or only the cells you selected before opening Find and Replace.
- After replacing, Excel tells you how many changes it made so you can undo if something went wrong.
Opening Find and Replace and entering your search terms
Press Ctrl+H on Windows or Command+Option+F on Mac to open the Find and Replace dialog. On Excel for the web, click the Edit menu and select "Find and Replace" from the dropdown.
Type the text or number you want to find in the "Find what" field. Type what you want to replace it with in the "Replace with" field. If you want to replace something with nothing (delete it), leave the "Replace with" field empty and click Replace or Replace All.
By default, Excel searches the entire sheet. If you selected specific cells before opening Find and Replace, you can limit the search to just those cells by choosing "Selection" from the "Within" dropdown. This is useful when you only want to change something in one column or one area of your spreadsheet.
Choosing between Replace and Replace All
Click Replace All if you are confident the search term appears only where you want to change it. Excel will replace every match at once and show you how many replacements it made. This is the fastest option when you know the text you are searching for is unique enough that you will not accidentally change something you meant to keep.
Click Replace to go through matches one at a time. Excel highlights the first match in your spreadsheet. You can then click "Replace" to change that one, or "Find Next" to skip it and move to the next match. This method takes longer but gives you control over which cells actually get changed.
If you make a mistake, press Ctrl+Z immediately to undo all the replacements. Excel will restore your spreadsheet to the state it was in before you clicked Replace All.
Using Match entire cell contents to avoid partial replacements
By default, Find and Replace will change text even if it is part of a longer word or phrase. For example, if you search for "cat" and replace it with "dog", a cell containing "category" will become "dogegory".
To replace only cells that contain exactly what you typed, check the box labeled "Match entire cell contents" before clicking Replace or Replace All. Now "cat" will only match cells that say exactly "cat" and nothing else. This prevents accidental changes to words that contain your search term.
Searching across multiple sheets or using wildcards
If your workbook has multiple sheets and you want to search all of them at once, open Find and Replace and look for the "Within" dropdown. Select "Workbook" to search every sheet. The default is "Sheet" which searches only the sheet you are currently viewing.
For more advanced searches, you can use wildcards — special characters that stand in for unknown text. The question mark ? matches any single character, and the asterisk * matches any number of characters. For example, searching for "cat*" will find "cat", "cats", "catalog", and "category". You must check the "Use wildcards" box before your search will recognize these characters.
You can also search for line breaks and other special characters. Click "Options" or "More" in the Find and Replace dialog to see the full list of codes you can use, such as ^n for a line break within a cell.
Making your search case-sensitive or matching formatting
By default, Find and Replace does not care about uppercase or lowercase letters. Searching for "john" will find "John", "JOHN", and "john". If you need to match the exact case, check the box labeled "Match case" before you search. Now "john" will only match cells with lowercase letters.
You can also search for and replace based on formatting — font color, bold, italics, or cell background color — rather than the text itself. Click the "Format" button next to the "Find what" field to specify formatting you want to search for. This is useful if you want to change all red text to blue text, or find all bold cells and remove the bold formatting.
Understanding what happens when you replace
When you click Replace All, Excel searches from the current cell to the end of the sheet, then wraps around to the beginning. It will not search cells you have already passed unless you started from the top of the sheet.
After the replacement is complete, Excel shows a message telling you how many replacements it made. If the number seems wrong or too high, press Ctrl+Z to undo. You can then try again with a more specific search term or use the "Replace" button one at a time to be more careful.
If you search for something that does not exist in your spreadsheet, Excel will tell you "Search key not found" and make no changes. This is a good sign that your search term is spelled differently than you expected or does not appear in the cells you are searching.
Frequently Asked Questions
Can I undo a Find and Replace if I made a mistake?
Yes. Press Ctrl+Z immediately after the replacement to undo all changes at once. If you waited and made other edits, you may need to press Ctrl+Z multiple times to get back to the state before the replacement. If you closed the file without saving, the changes are already undone.
How do I search for a question mark or asterisk if those are wildcards?
If you need to find the actual characters ? or *, you must escape them by putting a tilde ~ before them. Search for ~? to find a question mark, or ~* to find an asterisk. This only works if you have the "Use wildcards" box checked.
Will Find and Replace search inside formulas or only the cell values?
By default, Find and Replace searches the values that appear in cells, not the formulas behind them. If you want to search inside formulas, open Find and Replace, click "Options" or "More", and check "Search in formulas" or "Search within formulas" depending on your version of Excel.
Can I replace something in only one column without affecting the rest of the sheet?
Yes. Click the column header to select the entire column, then open Find and Replace. Make sure "Within" is set to "Selection" so the search only looks in that column. Then click Replace All to change only the matches in that column.
What is the difference between Replace and Replace All?
Replace changes one match at a time and lets you skip matches you want to keep. Replace All changes every match in your search area at once without stopping. Use Replace All when you are sure every match should be changed, and use Replace when you want to review each change first.