Open Find and Replace and search for what you need to change
The Find and Replace tool in Excel lets you search for text, numbers, or formulas across your entire spreadsheet and swap them out all at once. You do not have to hunt through each cell by hand. The tool works the same way in Excel for Windows, Excel for Mac, and Excel online.
To open Find and Replace, press Ctrl+H on Windows or Command+H on Mac. A dialog box will appear with two main fields: "Find what" and "Replace with". Type the text or number you want to search for in the first field.
If you are working in Excel online, the keyboard shortcut is the same. The dialog opens in the same place on your screen, and the steps that follow are identical.
Key Takeaways
- Press Ctrl+H (Windows) or Command+H (Mac) to open the Find and Replace dialog in any version of Excel.
- 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 click Replace All to change every match at once.
- Use the "Match entire cell contents" checkbox to avoid replacing part of a cell when you only want exact matches.
- Click "Replace" one at a time to review each change before it happens, or use "Replace All" to change everything without reviewing.
- You can undo any replacement by pressing Ctrl+Z when ready after, even if you replaced hundreds of cells at once.
Type the replacement text and choose Replace or Replace All
Once you have entered what you are looking for, click in the "Replace with" field and type the text or number you want to put in its place. If you want to delete something entirely, leave this field blank and click Replace All—Excel will remove every instance of the search term.
You now have two choices. Click Replace to change one cell at a time. Excel will highlight the first match, and you can review it before clicking Replace again to move to the next one. This is useful when you are not sure every match should be changed, or when you want to be careful about what gets swapped.
Click Replace All to change every match in the spreadsheet at once. Excel will tell you how many replacements it made. This is faster when you are confident the search term should be replaced everywhere it appears.
Use Match entire cell contents to avoid partial matches
By default, Find and Replace will match text anywhere inside a cell. If you search for "cat" and your spreadsheet contains cells with "catalog", "category", and "cat food", all three will be found and replaced. Often that is what you want, but sometimes it is not.
To match only cells that contain exactly what you typed and nothing else, check the box labeled "Match entire cell contents" before you search. Now a search for "cat" will find only cells that say exactly "cat", and will skip "catalog" and "category".
This option is especially useful when you are replacing codes, product numbers, or names where a partial match would change the wrong cells.
Search only in a specific column or range
If your spreadsheet is large and you only want to search part of it, select that range of cells before you open Find and Replace. Highlight the cells you want to search—click the first cell, hold Shift, and click the last cell in the range you want. Then press Ctrl+H to open Find and Replace.
Excel will search only within the cells you selected. This prevents accidental changes in other parts of your spreadsheet. If you do not select a range first, Find and Replace searches the entire sheet.
Use wildcards and special characters for flexible searches
Excel's Find and Replace tool understands wildcards—special characters that stand in for unknown text. The question mark ? matches any single character, and the asterisk * matches any number of characters. These are useful when you know part of what you are looking for but not all of it.
For example, if you search for "cat*" you will find "cat", "catalog", "category", and any other word that starts with "cat". If you search for "c?t" you will find "cat", "cot", and "cut" but not "coat".
To search for a literal question mark or asterisk (not as a wildcard), put a tilde ~ before it. Search for "~*" to find an actual asterisk character in your cells.
Undo a replacement if you change your mind
If you click Replace All and then realize the change was wrong, press Ctrl+Z when ready to undo it. Excel will restore every cell to what it was before the replacement, even if you replaced hundreds or thousands of cells. This works as long as you have not made other changes since the replacement.
If you have made other changes and want to undo only the replacement, you can still press Ctrl+Z multiple times to step backward through your recent actions. Each press of Ctrl+Z undoes one action in reverse order.
Find and Replace with formatting and formulas
Find and Replace can search for more than just text. You can search for cells that contain a specific formula, or you can replace text with a formula. Click the "Options" button in the Find and Replace dialog to see additional search choices.
Under "Format", you can search for cells with a specific font color, background color, or number format. This is useful if you want to find all cells formatted as currency and change them to a different format, or find all red text and replace it with blue text.
To search for a formula, type it in the "Find what" field exactly as it appears in the formula bar—for example, =SUM(A1:A10). You can then replace it with a different formula or with a value.
Frequently Asked Questions
Can I search for line breaks or special characters like tabs?
Yes. In the Find and Replace dialog, click Options to see the full search menu. You can search for line breaks by typing Ctrl+J in the Find field (on Windows) or Ctrl+Enter (on Mac). To search for a tab character, type Ctrl+Tab. These special characters will be found and replaced like any other text.
What if I only want to replace text in one column?
Select the entire column before opening Find and Replace. Click the column header to select the whole column, then press Ctrl+H. Excel will search and replace only in that column. You can also select a specific range within the column if you want to be more precise.
Does Find and Replace work on hidden cells?
Yes, Find and Replace will search hidden cells and rows. If you do not want replacements to happen in hidden cells, unhide them first, select only the visible cells you want to change, and then open Find and Replace.
Can I search for numbers with different formatting?
Find and Replace searches for the actual value in the cell, not how it is displayed. A cell formatted to show "$100.00" contains the number 100, so searching for "100" will find it. If you want to find cells with a specific number format (like currency), use the Format button in Options instead of typing in the Find field.
What happens if I replace something and then save the file?
Once you save, the replacement is permanent. Closing the file without saving will discard the changes. If you realize after saving that a replacement was wrong, you can undo it by pressing Ctrl+Z, but only if you have not closed and reopened the file. After you close and reopen, the undo history is gone.