To find and replace text only in selected Excel cells, select the range first, press Ctrl+H, enter the text in Find what and Replace with, then choose Replace or Replace All. In Excel for Microsoft 365 on Windows, a multi-cell selection limits the search to that selection; selecting only one cell does not create a one-cell-only search.
How selection affects Find and Replace
Excel’s Replace command can search a worksheet or workbook, but selecting a range before opening the dialog lets you target just that area. This is useful when the same label or code appears in several parts of a worksheet but should change in only one table. For example, a workbook might use “Pending” in both a current-orders list and an archive; selecting the current list helps prevent changing the archive by mistake.
The important distinction is between selecting a range and merely placing the active-cell cursor somewhere. If only one cell is active, Excel generally searches the sheet rather than treating that cell as the complete search area. Select at least two cells, or select the intended table or column range, before using Replace. If you need to replace a value in just one cell, edit that cell directly or select a multi-cell range that contains it and use the dialog.
The selection defines the cells Excel considers, while the dialog’s Within setting defines whether Excel searches the sheet or workbook. For a focused task, leave Within set to Sheet and make the selection first. If you choose Workbook, Excel can search other worksheets too, so review that setting before replacing anything.
Steps to replace text in a selected range
- Select the cells you want to affect. Drag across a range, click the first cell and Shift-click the last, or select a data column range such as B2:B200. Avoid including headers if they contain words that could match.
- Open the Replace tab by pressing
Ctrl+H, or use Home > Find & Select > Replace. - Type the existing text or value in Find what. Type the new text in Replace with. Leave Replace with empty if the intention is to remove the matching text.
- Choose Replace to review matches one at a time, or choose Replace All to change every match in the selected range.
- Read Excel’s confirmation message, which reports how many replacements it made, and inspect the affected cells before continuing with other edits.
For a large or important range, start with Find All on the Find tab or use Replace once or twice before choosing Replace All. This gives you a chance to confirm that the intended cells match. If the result is wrong and no later action has interfered, press Ctrl+Z immediately to undo the replacement.
Settings that change what Excel matches
The Replace dialog includes options that can make a search narrower or broader. Expand Options if you do not see them. Check these settings when Excel finds too much, too little, or a result you did not expect:
- Within: Choose Sheet to search the current worksheet or Workbook to search across worksheets. A selected range is most useful with Sheet selected.
- Search: By Rows or By Columns changes the order Excel searches; it does not change which cells are eligible.
- Look in: Excel can search formulas or displayed values, among other available content types. The choice matters when a cell contains a formula.
- Match case: Turn this on when uppercase and lowercase letters must be treated differently. With it off, a search for “east” can also match “East.”
- Match entire cell contents: Use this when the cell must contain exactly the search term, not merely include it within a longer entry.
- Format: Find and Replace can use formatting criteria as well as text criteria. Clear unintended format criteria if the dialog seems to miss otherwise obvious matches.
These options may retain settings from an earlier search, so do not assume the dialog has returned to its defaults. For example, if Match entire cell contents is selected, searching for “NY” will not find “NY-104.”
Examples: partial text and whole-cell matches
Suppose cells A2:A50 contain shipping labels such as “North depot,” “North returns,” and “South depot.” Select A2:A50 and replace “North” with “Central” to change the matching part of each label while preserving the rest of the text. The results would include “Central depot” and “Central returns.” Do not select the entire worksheet if the same word appears in notes or other tables that should remain unchanged.
By contrast, if cells contain status values such as “Open,” “Open – delayed,” and “Closed,” and only the exact status “Open” should change, select the relevant status cells and turn on Match entire cell contents. Replacing “Open” with “In progress” then avoids changing “Open – delayed.” Without that setting, a search term can match part of a longer cell entry.
Replacing with an empty entry removes the match, not necessarily the whole cell’s contents. If A2 contains “Order: 4821” and you replace “Order: ” with nothing, the remaining cell value is “4821.” If you instead need to clear entire cells, selecting them and pressing Delete is a different operation; it removes cell contents rather than performing a text substitution.
Finding text in values, formulas, and comments
A worksheet cell can display a value that is produced by a formula. For example, a formula might assemble a customer name and a region. Replacing text while Look in is set to Formulas searches the formula text itself, not simply the displayed result. If you replace a fragment of a formula, you may alter a cell reference, text string, or function argument and change the calculation. Inspect formula cells carefully before making a bulk replacement.
When the target is ordinary typed text, choose the appropriate search content type and test a single replacement first. A displayed number may also be stored as a number rather than text, even if it looks similar. Find and Replace is not a general-purpose way to change a number’s display format; use number formatting when the underlying value should stay the same and only its appearance needs to change.
Excel’s search options can also include notes or comments depending on the version and dialog. That is separate from replacing cell values. If the intended text is in a note or a threaded comment, confirm the selected content type rather than assuming the search is checking the visible worksheet cells alone.
Using wildcards for flexible searches
In the Find what field, Excel supports wildcards for matching patterns. An asterisk (*) represents any number of characters, while a question mark (?) represents one character. For instance, searching for ref-* can find entries beginning with “ref-” followed by any text. These patterns can make Replace All powerful, but they can also match more cells than a literal search.
To search for an actual asterisk or question mark rather than use it as a wildcard, put a tilde before it: ~* or ~?. Use a tilde before another tilde to search for a literal tilde. If the pattern could match many different values, use Find All or individual Replace actions first to check the results. Wildcards are for the search pattern; they are not a substitute for reviewing the cells that will be changed.
Common problems and how to avoid them
- Excel changes cells outside the intended area: Reselect the range, check that it contains multiple cells, and confirm Within is set to Sheet. A single active cell is not the same as a restricted range.
- No matches appear: Check spelling, spaces, Match case, Match entire cell contents, Look in, and any saved Format criteria. A trailing space in either the cell or search term can also prevent the match you expect.
- Only part of a label changes: That is normal when Match entire cell contents is off. Enable it if only complete-cell matches should be replaced.
- A formula changes unexpectedly: Check whether Excel searched formulas and whether the replacement text occurs inside a formula. Undo promptly if the result is not intended.
- Some cells seem unavailable: A protected worksheet may prevent edits, and merged cells or filtered data can make selection and review less straightforward. Check sheet protection and inspect the actual selected range before replacing.
Filtered rows deserve special attention: selecting a range that includes filtered-out rows does not necessarily mean that only visible records are targeted. If the operation must affect visible rows only, verify the selection and test on a copy or a small sample rather than assuming that a filter alone limits Replace All.
Excel for Mac and Excel for the web
In Excel for Microsoft 365 on Mac, the ribbon command is generally available through Home > Find & Select > Replace; keyboard shortcuts can differ with the keyboard layout and macOS settings. Use the ribbon command if Ctrl+H does not open the expected dialog. The main approach remains the same: select the range, open Replace, and inspect the search scope and options.
Excel for the web has a browser-based interface, and available search controls can differ from the Windows desktop dialog. If you need precise control over search scope, formula contents, or advanced options, open the workbook in the desktop app and verify the selection there. In any version, the safest check is to confirm the range and preview a match before using Replace All.
Safer ways to handle large replacements
Before replacing many entries, save the workbook or create a copy. This is especially sensible for shared workbooks, imported data, and replacements involving short terms such as “in” or “1,” which may occur in unintended places. Excel usually lets you undo a replacement with Ctrl+Z, but undo is not a substitute for a backup if you continue editing, close the workbook, or discover the problem later.
For recurring cleanup, consider whether Find and Replace is the right tool. If you need to preserve the source data, use a helper column or a formula-based transformation and review the results before copying them back as values. If the task is simply to standardize a few labels once, a carefully selected range and a checked Replace operation are usually more direct. Avoid running a broad replacement across an entire workbook merely because it is faster to select everything; a small amount of scope checking can prevent extensive cleanup afterward.
Frequently Asked Questions
Can I use Find and Replace in only one Excel column?
Select the cells in that column that should be changed, such as B2:B100, then open Replace. Selecting the used data range rather than the whole column can help avoid changing a header or unrelated entries.
Does Excel replace text only in the selected cells?
When a multi-cell range is selected before opening Replace, Excel can restrict the search to that selection. A single active cell generally leaves the search covering the sheet, so make an actual range selection and verify the Within setting.
Can I replace part of a cell without changing the rest?
Yes. Search for the substring and enter its replacement. For example, replacing “Ltd” with “Limited” changes that matching text while keeping other characters in the cell. Leave Match entire cell contents off for this kind of partial match.
How do I replace a word only when it is the whole cell?
Select the relevant range, open Replace, expand Options, and enable Match entire cell contents. Then search for the whole word and replace it. This avoids matching that word as part of a longer cell entry.
Can I replace text in formulas?
Excel can search formula contents when Look in is set to Formulas, but replacing within formulas may change their logic or references. Use this only when you understand the formula text being changed, and test a small number of cells first.
Can I undo Replace All?
Usually, press Ctrl+Z immediately after the replacement. If you have performed other actions, closed the workbook, or run a macro, undo may not restore the original state, so save a copy before a large or risky replacement.
Related
- Excel Box and Whisker Plot: What Column Names Mean
- Excel Automatic Goal Seek: Options for Repeated Models
- Excel Auto Merge Cells With the Same Value? Here’s How
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Not Clicking the Correct Cell? Causes and FixesIf Excel is not clicking the correct cell, first press Esc, set the worksheet zoom to 100%, and…
- Auto Loan Amortization Schedule in Google SheetsYes—Google Sheets can create an auto loan amortization schedule that shows each monthly payment’s interest, principal, and remaining…
- Excel Dropdown List: Create, Edit, and Troubleshoot OneTo make a dropdown list in Excel for Microsoft 365 on Windows, select the cell or cells, choose…
- Clear Cache in Outlook Mail: Windows, Web, and MacTo clear cache in Outlook, first choose the version you use: in classic Outlook for Windows, clear a…
- Upper Excel Shortcut: How to Capitalize TextExcel has no built-in keyboard shortcut that turns the selected cell’s text into uppercase. With the text maria…
- Google Sheets: Change Cell Color When a Checkbox Is CheckedYes. In Google Sheets, insert a checkbox, then use Format > Conditional formatting to apply a fill color…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.