To find and replace text in only part of an Excel worksheet, select the cells or range first, press Ctrl+H, enter the text to find and its replacement, then choose Replace or Replace All. Check the selection and test a single replacement before changing many cells. This guide covers the steps for Excel for Microsoft 365 on Windows, plus scope checks and notes for Mac and Excel for the web.
What You’ll Need
- An Excel workbook with the data you want to update. If the changes matter, save a copy first so you can recover the original easily.
- A clear idea of which cells should be searched. Select a single cell to search the current sheet, or select a specific range to limit the operation to that range.
- The exact text to find and the replacement text, including spaces, punctuation, and capitalization where relevant.
Step-by-Step
- Save a copy if the change could be hard to reverse. Use File > Save As to make a separate copy, or save the workbook before starting. Excel normally lets you undo a replacement with Ctrl+Z, but a copy is useful insurance before a broad Replace All or a change to important records.
- Select the cells you want Excel to search. Click and drag across a continuous range, such as A2:A50, or click its first cell and Shift-click its last cell. To search one column, select the relevant cells in that column rather than the whole worksheet. If you select just one cell, Excel generally searches the current worksheet rather than limiting the search to that one cell. For a targeted replacement, make a multi-cell selection that covers the intended data.
- Open Find and Replace. Press Ctrl+H on Windows. You can also use Home > Find & Select > Replace. The Find and Replace dialog opens with the Replace tab ready. On Excel for Mac, Control+H is the usual shortcut; if it does not open the dialog on your keyboard setup, use the Home tab’s Find & Select menu. Excel for the web has a browser-based interface, so the available commands and selection behavior can differ from desktop Excel.
- Enter the search text. In the Find what box, type the text or characters that should be changed. Copying a value from a cell can help avoid mistyping spaces or punctuation. For example, to change the spelling Northwind Ltd, enter that exact wording. Do not add quotation marks unless they are actually part of the cell contents.
- Enter the replacement. In the Replace with box, type the new text. For the example above, you might enter Northwind Limited. To remove the found text, leave Replace with blank. Review the wording carefully: Excel replaces the matching text wherever it occurs in the cells within the search scope, not just the first visible instance in each cell.
- Review the search options before replacing. Select Options in the dialog if the extra settings are not visible. Confirm that Within is set to Sheet when you intend to work on the current worksheet, and check that the selected cells are the intended range. Match case makes the search case-sensitive; Match entire cell contents restricts matches to cells whose complete contents equal the search text. Look in determines whether Excel searches formulas, values, or another available content type. Settings can remain from an earlier search, so check them rather than assuming they are at their defaults.
- Test the match before changing everything. Choose Find Next to move to a match, or Find All to see a list of matches. Check the selected cell and its surrounding data. If the match is not the one you intended, adjust the search phrase or options before replacing anything. For a controlled change, click Replace to update the current match and inspect the result, then continue one match at a time.
- Use Replace All only after confirming the scope. Click Replace All to update every match in the current search scope. Excel reports how many replacements it made. Compare that number with your expectation: a count much higher or lower than expected is a reason to undo immediately with Ctrl+Z and revise the selection or options. Replace All can change many cells at once, so do not click it just to see what happens.
- Verify the result and save. Search again for the original text to see whether any matches remain. A remaining match may be outside the selected range or may differ in capitalization, spacing, or content type. Also inspect representative cells to confirm that the new text reads correctly and that formulas or related data were not changed unintentionally. Save the workbook when the result is correct.
Important scope detail: A selected range is the practical way to target part of a sheet, but the dialog’s Within setting, the active worksheet, and the current selection all matter. Keep the search on the intended sheet, avoid switching to Workbook scope when you want a local change, and use Find Next to confirm a match lies inside the target data before choosing Replace All. If you need to change separate, non-adjacent areas, handle each area separately and check the results rather than relying on a complicated multi-selection.
Common Mistakes
- Selecting one cell and expecting a one-cell search. A single active cell usually leaves the search aimed at the worksheet. Select the full range you mean to edit, or use a deliberate one-at-a-time replacement if you only want one occurrence.
- Replacing a short fragment that appears in other words. Searching for art can match part of department as well as the standalone word. Use a more distinctive phrase, or enable Match entire cell contents when complete-cell matching is what you want.
- Overlooking spaces or punctuation. A trailing space in Find what can make a search appear to miss a value. Conversely, searching a phrase without its punctuation may replace a substring in a longer phrase. Inspect a sample cell and copy its text if exact spacing matters.
- Assuming capitalization is always ignored. Excel’s Match case setting affects whether upper- and lowercase characters must match. Check it when changing codes, product IDs, or text where capitalization distinguishes entries.
- Forgetting that formulas can be searched. If Look in is set to formulas, a search can match text within formula expressions, not only displayed results. Replacing formula text can alter how a formula works. Use the correct Look in setting and be especially cautious before replacing across a worksheet containing formulas.
- Using Replace All before confirming the number of matches. An unexpected count can mean the selection was too broad, the search phrase was too general, or the scope setting was not what you intended. Check the count and undo promptly if it does not make sense.
Tips
- Start with a narrow range. When you only need to update one table column, select the data cells in that column and leave headings and unrelated columns out. A smaller selection is easier to verify and reduces the chance of changing labels or notes.
- Use Find All as a review step. It lists matching cells so you can judge whether the search phrase is too broad. This is helpful when the same text occurs in several tables or in both labels and longer descriptions.
- Know what the wildcard characters do. In Excel’s Find and Replace, an asterisk can stand for a string of characters and a question mark can stand for one character. To search for a literal asterisk, question mark, or tilde, prefix it with a tilde in the Find what box. Wildcards can make a search flexible, but they can also match far more cells than a literal search.
- Use one-at-a-time replacement for ambiguous matches. If some matches should change and others should stay, use Find Next and Replace for each appropriate match. Replace All is best when every match in the selected scope should receive the same change.
- Remember that formatting can be part of the search. The dialog can include formatting criteria through its Format options. If a search unexpectedly finds nothing, inspect those options and clear an unwanted format condition. If you intentionally want a format-specific search, confirm the format shown in the dialog before replacing.
- Keep a record of broad changes. For a large cleanup, note the original phrase, replacement, worksheet, and expected number of matches. That simple record makes it easier to check the result and explain what changed if another person uses the workbook.
Troubleshooting
Excel finds no matches. Confirm that the correct worksheet is active and that Within is set to the intended scope. Check for extra spaces, different punctuation, or a mismatch between the selected Look in option and the type of content you are searching. If Match case or Match entire cell contents is selected, turn it off for a broader search and try Find Next again.
Replace All changes more cells than expected. Press Ctrl+Z immediately, before making other edits. Re-select the intended range, choose Sheet rather than Workbook if you only mean one sheet, and make the search phrase more specific. Use Find All to inspect the matches before trying again. If the replacement affected formulas or other important content, verify those cells after undoing or restore the saved copy.
The replacement misses some instances. Search again for the original text and inspect a remaining example. It may have different capitalization, a nonbreaking or extra space, punctuation, or a formula result that is not being searched under the current Look in setting. Adjust the search criteria to match the actual content. If the remaining instance is outside the selected range, include it deliberately or process its range separately.
The Replace command or shortcut is hard to find. On Windows, use Ctrl+H or Home > Find & Select > Replace. On Mac, try Control+H or the equivalent Find & Select command in the Home tab. Excel for the web may place search controls differently and may not behave exactly like the desktop dialog; if you need precise range-based replacement, open the workbook in the Excel desktop app and verify the selection there.
Undo does not restore the change. Ctrl+Z can undo a recent replacement, but later workbook actions may affect the undo history, and some operations or workflows may not be undoable as expected. If Undo is unavailable or the result is uncertain, close without saving if appropriate, or restore the separate copy you made before starting. For future broad replacements, save a copy first and verify the replacement count before continuing.
Frequently Asked Questions
How do I replace text only in selected cells in Excel?
Select the range of cells first, press Ctrl+H on Windows, enter the search and replacement text, and confirm the scope is the intended sheet. Use Find Next to check a match within the selection before choosing Replace All. For a one-cell selection, do not assume the search is restricted to that cell; select a multi-cell range when you need a limited area.
Can I replace text in one column without changing the rest of the sheet?
Yes. Select the relevant data cells in that column, not the entire worksheet, before opening Replace. If the column has a heading, leave the heading out of the selection unless it should also be changed. Review the matches and the replacement count before accepting a bulk change.
What is the difference between Replace and Replace All?
Replace changes the current match and lets you inspect matches as you move through them. Replace All changes every match in the active search scope and then reports the number of replacements. Choose Replace when you need to approve matches individually; choose Replace All only when all matching cells should be changed.
Can Find and Replace change part of a cell, or only the whole cell?
It can replace a matching part of a cell’s text. For example, a search for a phrase may replace that phrase inside a longer description. Turn on Match entire cell contents if you want to match only cells whose complete contents equal the search text.
Does Find and Replace work with formulas?
Yes, depending on the Look in setting. Searching formulas can find text in the formula expression itself, while searching values looks at displayed or stored results. Be careful: replacing text inside a formula can change the calculation, not just its displayed result. Save a copy and test a match before using Replace All on formula cells.
Can I undo Replace All?
Usually, Ctrl+Z undoes a recent Replace All in desktop Excel. Use it immediately if the replacement count or result is wrong, before making further changes. A saved copy is the safer fallback for important workbooks, especially when the undo command is unavailable or the workbook has gone through other operations.
Related
- Excel Day Tracker: Build a Daily Log for Work and Habits
- Excel Day Trading Journal: Build a Useful Trade Log
- Excel Not Tabbing to Next Cell? Fixes That Work
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Conditional Formatting Excel Dates Overdue: How to Set It UpTo highlight overdue dates in Excel, select the cells to format and create a formula-based conditional formatting rule.…
- Power Query: Select Columns and Keep the Fields You NeedTo select columns in Power Query for Excel, open the query in Power Query Editor, then choose Home…
- How to Combine Cells in Excel and Keep All ValuesTo keep every entry, combine the cell contents into a result first, copy that result, and use Paste…
- How to Add a Drop-Down List in Excel: Step-by-StepTo add a drop-down list in Excel for Microsoft 365 on Windows, put the choices in cells, select…
- Power Query Errors: Causes, Meanings, and FixesA Power Query error means that a query step could not interpret, retrieve, or transform something it was…
- How to Insert a Row in Excel Above a Selected CellTo insert a worksheet row above a cell in Excel for Microsoft 365 on Windows, select any cell…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.