The Find and Replace tool in Excel lets you search for specific text or numbers and swap them for something else across your entire spreadsheet at once
Open the Find and Replace dialog by pressing Ctrl+H on Windows or Command+H on Mac. Type what you want to find in the "Find what" field and what you want to replace it with in the "Replace with" field. Then choose whether to replace one instance at a time or all of them at once. The tool searches through every sheet in your workbook unless you tell it otherwise.
This is faster than manually editing each cell, especially in large spreadsheets where the same text appears dozens or hundreds of times. You can search for exact matches only, or find text that appears anywhere within a cell — like finding "John" whether it appears as "John Smith" or "John Jr."
Key Takeaways
- Press Ctrl+H (Windows) or Command+H (Mac) to open Find and Replace, or use the Edit menu.
- Type what you want to find and what you want to replace it with, then choose Replace All to change everything at once or Replace to change one at a time.
- Use Match entire cell contents if you want to find only cells that contain exactly what you typed, nothing more.
- The tool searches all sheets in your workbook by default, but you can limit it to the current sheet only.
Opening Find and Replace and entering your search terms
The quickest way to open Find and Replace is the keyboard shortcut: Ctrl+H on Windows or Command+H on Mac. If you prefer the menu, go to the Edit menu and click Find and Replace.
In the Find and Replace dialog box, type the text or number you want to search for in the "Find what" field. In the "Replace with" field, type what you want to replace it with. If you want to delete something entirely, leave the Replace with field empty and click Replace All.
By default, Excel searches for your text anywhere within a cell. If a cell contains "New York" and you search for "York", it will find it. If you want to find only cells that contain exactly "York" and nothing else, check the box labeled "Match entire cell contents" before you search.
Replacing one instance or all at once
After you enter your search term, you have two options. Click Find All to see every cell that contains your search term — Excel will highlight all of them and show you a list. This is useful if you want to review what will change before you commit to anything.
Click Replace to change just the first instance it finds. Excel will move to the next match after you click Replace, so you can go through one by one and decide which ones to change. This takes longer but gives you control over each change.
Click Replace All to change every instance at once. Excel will tell you how many replacements it made. Use this when you are confident the search term appears only where you want it to change — for example, replacing a department name that appears nowhere else in your spreadsheet.
Limiting your search to the current sheet
By default, Find and Replace searches through every sheet in your workbook. If you have multiple sheets and want to search only the sheet you are currently viewing, click the "Options" button to expand the dialog, then look for "Sheet" in the dropdown menu and select "Current Sheet".
This prevents accidental changes in other sheets. For example, if you have a sheet called "2024 Data" and another called "2023 Data" and you want to replace text only in the 2024 sheet, limiting your search to the current sheet ensures the 2023 sheet stays unchanged.
Using case sensitivity and other search options
If you want to find "John" but not "john", check the "Match case" option before you search. This makes your search case-sensitive, so it will only find exact matches of uppercase and lowercase letters.
You can also search within formulas or values only. If a cell contains a formula that produces the number 100, and you search for "100", the tool will find it by default. If you want to search only the formulas themselves (the code behind the cell), click Options and choose "Formulas" from the "Search" dropdown.
The "Find All" button is useful for checking your work. Click it before you use Replace All, and Excel will show you every cell that matches your search. Review the list to make sure you are not about to change something you did not intend to.
Undoing a replace if something goes wrong
If you click Replace All and realize you made a mistake, press Ctrl+Z (Windows) or Command+Z (Mac) immediately to undo the change. Excel will reverse every replacement you just made and restore your spreadsheet to how it was before.
This is why it is a good idea to use Find All first to review what will change, especially if you are replacing something common like a single letter or number. A search for "a" will find thousands of cells, and undoing a Replace All on that scale takes a moment to process.
Finding and replacing with wildcards and patterns
If you want to find text that follows a pattern, you can use wildcards. The asterisk (*) stands for any number of characters, and the question mark (?) stands for a single character. To use wildcards, click Options and check the "Use wildcards" box.
For example, if you search for "John*" you will find "John Smith", "John Jr.", and "John Doe" — anything that starts with "John". If you search for "John?" you will find only "Johns" (John plus one character). This is useful for finding variations of names or product codes that follow a pattern.
Frequently Asked Questions
Can I find and replace across multiple workbooks at once?
No, Find and Replace works on one workbook at a time. You must open each workbook separately and run Find and Replace in each one. If you need to make the same change across many files, you will need to repeat the process for each file.
What happens if I search for something that does not exist in my spreadsheet?
Excel will display a message saying "Search key not found" and the dialog will stay open. You can then change your search term and try again. This prevents accidental replacements when you mistype what you are looking for.
Can I undo a Replace All if I wait a while after doing it?
Yes, as long as you have not closed the file. The undo history stays active until you close the workbook. Once you close and reopen the file, the undo history is cleared and you cannot undo the replacement. Save your work before using Replace All if you are unsure about the change.
Does Find and Replace work on cell formatting or only on the text inside cells?
Find and Replace works on the text and numbers inside cells, not on formatting like color or font. If you want to find cells with specific formatting, you need to use the Find feature with formatting options, which is a separate tool in the Edit menu.
Can I search for line breaks or special characters?
Yes, but you need to use special codes. To find a line break within a cell, click Options, check "Use wildcards", and search for "~n" (tilde followed by the letter n). For other special characters, you may need to use regular expressions, which requires checking the "Use regular expressions" option in the advanced settings.