Search and Replace in Excel lets you quickly find specific text, numbers, or formatting across one or more worksheets and substitute it with new content—saving time on manual edits, especially in large datasets. You don’t need any extra tools or add-ins; it’s built into Excel on Windows, Mac, and web versions.
What You'll Need
- Microsoft Excel (any recent version: 2016, 2019, 2021, Microsoft 365, or Excel for the web)
- A workbook open with data you want to edit
- Basic familiarity with Excel cells and ranges (optional but helpful)
Step-by-Step
- Open your Excel workbook and navigate to the worksheet where you want to perform the search and replace. If you want to apply it across the entire workbook, make sure you’re on any sheet (steps for workbook-wide action are in Step 4).
- Press Ctrl + H (Windows) or Command + Shift + H (Mac) to open the Find and Replace dialog box directly. Alternatively, click the Home tab, then in the Editing group, click Find & Select > Replace.
- In the Find and Replace dialog, enter the exact text or value you want to find in the Find what field. For example, type
OldProductor100. Be precise—Excel matches case only if you enable it (see Step 5). - Enter the replacement text or value in the Replace with field. If you want to delete content, leave this field blank. Do not include extra spaces unless intentional.
- Optionally, click Options to expand more settings. Under Look in, choose Values (for cell contents), Formulas (to search underlying formulas), or Comments (for cell notes). Under Match, check Match entire cell contents if you only want exact matches (e.g., searching for
10won’t match100), and check Match case for case-sensitive replacements. - Click Find Next to preview occurrences one by one, or click Replace All to update every match in the current sheet at once. A confirmation message will show how many replacements were made (e.g., “4 replacements made”). Click OK to close the message.
- To apply search and replace across all worksheets, ensure the Within dropdown (top right of the dialog, visible only after clicking Options) is set to Workbook instead of Sheet. Then click Replace All. This affects every sheet in the file—proceed with caution if sheets have unique data.
Common Mistakes
- Partial matches causing unintended changes: Searching for
Janwithout checking Match entire cell contents may replaceJanuary,Janitor, orJan2023. Always verify match scope before clicking Replace All. - Ignoring hidden characters: Extra spaces, non-breaking spaces (from web copy-paste), or line breaks inside cells can prevent matches. Use
TRIM()orCLEAN()functions first if invisible characters are suspected. - Overlooking formulas: If cells contain formulas like
=A1 & " Old", searching forOldin Values won’t find it—switch to Formulas to locate and replace those. - Replacing in the wrong sheet: By default, Replace operates on the active sheet only. Users often assume it’s workbook-wide and accidentally leave other sheets untouched.
- Case sensitivity errors: Without Match case,
ERRORandErrorare treated identically, which may cause inconsistent branding or formatting.
Tips
- Use wildcards carefully: If Match entire cell contents is unchecked, you can use
*(any characters) or?(single character). For example,Prod*findsProduct,Prod123, etc. But be precise—*Error*could match many unintended cells. - Backup first: Before clicking Replace All, save a copy of your workbook (File > Save As) or undo changes with Ctrl + Z immediately after.
- Search for formatting: To replace cell color, font, or borders, click Format next to Find what, choose a format, then click Format next to Replace with and select the new format. This is under Home > Find & Select > Replace > Options > Format.
- Use Find to preview: Run Find (Ctrl + F) first to list all matches before initiating Replace. This helps avoid surprises.
- Excel for the web limitation: In the browser version, go to Home > Find & Select > Replace, but you must select a range first—searching the entire sheet may not work reliably.
Troubleshooting
- No matches found, but you know they exist: Check Look in (Values vs. Formulas), Match case, and Match entire cell contents. Also inspect for hidden characters by copying the cell content into Notepad to strip formatting, then retype the search term.
- Replace All says “0 replacements”: Confirm you’re searching the correct sheet or workbook scope. Try selecting a specific range first (highlight cells), then open Replace—this forces the action on the selection.
- Unintended replacements occurred: Press Ctrl + Z immediately to undo. If too late, restore from a backup or use Excel’s version history (File > Info > Version History).
- Dialog box won’t open or freezes: Restart Excel. If the issue persists, disable add-ins (File > Options > Add-ins > Manage COM Add-ins > uncheck all), then retry. Corrupted files can also cause glitches—try opening in Safe Mode (hold Ctrl while launching Excel).
- Replace works on one sheet but not another: Check if sheets are protected. Go to Review > Unprotect Sheet (password may be required). Also, verify that the target cells don’t contain protected formulas (Review > Allow Users to Edit Ranges).
Frequently Asked Questions
Can I search and replace across multiple workbooks at once?
No—Excel’s Find and Replace only works within a single open workbook. To apply changes across files, open each workbook one by one and repeat the process, or use Power Query or VBA for automation (not covered here).Does Search and Replace work on formulas?
Yes, but only if you set Look in to Formulas in the dialog. By default, it searches Values, so formula text like=SUM(A1:A10) won’t appear unless you switch this setting.
Can I use wildcards like * or ? in Find what?
Yes, but only if Match entire cell contents is unchecked. For example,St* finds Star, Store, etc. To search for literal asterisks, type ~* (tilde escapes special characters).
How do I undo a Replace All mistake?
Press Ctrl + Z immediately after the replacement. Excel stores only the last action in undo history, so act quickly. For larger corrections, use File > Info > Version History (if enabled) or restore from a backup file.Why does Excel ignore leading zeros (e.g., 00123)?
Excel stores numbers without leading zeros internally. If you type00123 in a cell, it becomes 123. To preserve zeros, format the column as Text before entering data, or prefix the value with an apostrophe (e.g., '00123).