excel
How to Find and Replace in Excel Without Errors
Press Ctrl+H to open Find and Replace in Excel, type the text to find and its replacement, then use Options to control the match. Match entire cell contents stops partial matches, Match case fixes casing, and wildcards (? and *) widen the search. Select a range first to limit the damage.
Knowing how to find and replace in Excel means swapping one value for another across a selection, a sheet, or an entire workbook in a single pass. Unlike editing cells by hand, it changes every match at once — which is exactly how it quietly damages a file. The options are what keep it safe.
Open Find and Replace and set the scope
Scope is the first decision, and the one people skip. Excel replaces inside whatever you gave it, so define that before you type anything.
Press Ctrl+H for the Replace tab, or Ctrl+F for Find. Microsoft documents Control+F or Command+F for Find on a Mac, with Control+H for Replace [1]. The menu route is Home > Editing > Find & Select > Replace, which lands in the same dialog.
Then choose how wide the search goes:
- Select a range first. Highlight a column or block of cells and Excel confines the search to that selection. This is the single most effective guard against collateral damage.
- Within. Set it to Sheet or Workbook [1]. Workbook is the option that turns a five-cell fix into a hundred-cell surprise, so leave it on Sheet unless you mean it. In Excel for the web the same control offers Selection, Sheet, or Workbook [1].
- Search. By Rows is the default; By Columns changes the order matches are found in [1]. On the web it reads Down or Up instead [1].
One asymmetry is worth knowing before you start. The Look in box offers Formulas, Values, Notes, and Comments — but Microsoft notes that the Replace tab supports only Formulas [1]. You can find a value that a formula produced; you cannot replace it. Replacement always writes to what the cell actually contains, which for a calculated cell is the formula, not the number you see.
The options that decide what actually changes
Click Options and the dialog doubles in size. The four controls hiding there are the difference between a clean fix and a corrupted column.
| Option | What it does | Reach for it when |
|---|---|---|
| Match case | Makes the search case-sensitive [1] | Fixing ACME without touching Acme |
| Match entire cell contents | Only matches cells equal to the whole search string [1] | Replacing NA without hitting NAME or Canada |
| Look in: Formulas / Values | Searches cell contents or displayed results [1] | Rewriting a cell reference across many formulas |
| Format / Choose Format From Cell | Matches on formatting, not text [1] | Clearing one stray fill colour or number format |
Match entire cell contents deserves the most attention, because its default (off) is the cause of most Find-and-Replace accidents. With it off, replacing Inc with Incorporated also rewrites Incident, Include, and Vincent. With it on, only a cell holding exactly Inc changes.
The Format button is the least-known and genuinely useful one. Choose Format From Cell lets you click a badly formatted cell and find every other cell that matches it — a fast way to hunt down a single red-filled row that somebody left in a report.
Before committing, click Find All rather than Replace All. Excel lists every match with its cell address, and the count at the bottom tells you the size of what you are about to change. If the number is wildly higher than you expected, your search string is too loose.
Wildcards and the tilde that escapes them
Wildcards turn one search into a pattern, and Excel supports exactly three characters.
Microsoft documents them as a question mark for any single character, an asterisk for any number of characters, and a tilde to escape the other two [2]:
sm?thfinds smith and smyth [2]*eastfinds Northeast and Southeast [2]fy06~?finds the literal text fy06? [2]
They apply to Excel for Microsoft 365, 2024, 2021, 2019, and 2016, and work in text filters and in conditional formatting rules that use the "cells that contain specific text" criteria [2].
The escape rule is what trips people up. A question mark and an asterisk are common in real data — product codes, footnote markers, imported placeholders like *missing*. Searching for them without a leading tilde matches almost everything in the column, and Replace All then empties it. Write ~* for a real asterisk, ~? for a real question mark, and ~~ for a tilde.
What Excel does not have is regular expressions. There is no capture group, no character class, no way to say "any four digits". Google Sheets does offer this: its find-and-replace panel includes a "Search using regular expressions" checkbox alongside Match case, Match entire cell contents, and "Also search within formulas" [4]. If your fix genuinely needs a pattern rather than a wildcard, Sheets is the spreadsheet with the feature — at the cost of putting the file on Google's servers first.
When a formula beats Replace All
Replace All overwrites your source data. A formula does not, and that difference matters on any file you cannot re-download.
SUBSTITUTE is the direct equivalent. Microsoft gives the syntax as SUBSTITUTE(text, old_text, new_text, [instance_num]), and documents that when instance_num is supplied only that occurrence is replaced, while omitting it changes every occurrence of old_text in the string [3]. So =SUBSTITUTE(A2,"Ltd","Limited") fixes every instance in the cell, and =SUBSTITUTE(A2,"-","",2) removes only the second hyphen — something the dialog cannot express at all.
Neither function collapses spelling variants, though. SUBSTITUTE needs the exact string you are replacing, so Acme Inc, ACME Incorporated, and Acme, Inc. stay three values until you write three rules. Grouping them automatically is a clustering job, and where OpenRefine's clustering earns its setup cost sets out when that heavier tool is the right answer.
REPLACE is the positional sibling. Microsoft's own guidance draws the line clearly: use SUBSTITUTE to replace specific text in a string, and REPLACE to replace whatever text sits at a specific location [3]. Stripping a fixed three-character prefix from every ID is a REPLACE job; fixing a company suffix is a SUBSTITUTE job.
The trade-off is the same one that applies to combining columns with a formula: the result is a live calculation in a second column, not a value. Before you export, copy the formula column and use Paste Special > Values — otherwise the CSV inherits either the formula text or a column of #REF! errors once the source is deleted. The same trap catches a formula-based split of a full-name column, which is why that guide converts to values before the original column goes.
Why Replace All goes wrong on a fresh export
Most Find-and-Replace disasters happen on a file that arrived that morning from a CRM, a payroll system, or a survey tool. Four failure modes account for nearly all of them.
Partial matches. Covered above, and the reason Match entire cell contents exists. Test with Find All first.
Hidden characters that are not what they look like. A value that appears to contain a space may hold a non-breaking space, character 160, which arrives with anything copied out of a web page or PDF. Typing a normal space in the Find box will not match it. That whole class of problem, and the SUBSTITUTE-with-CHAR(160) fix, is covered in the guide to removing spaces in Excel.
Excel reformatting values on the way in. This one happens before you open the dialog. Opening a CSV in Excel converts date-like strings into dates and drops leading zeros from ZIP codes and phone numbers. Your replacement then runs against data Excel has already altered, and no undo step recovers the original digits. The only reliable way around it is not to open the file in a spreadsheet at all — swapping the text directly in the CSV leaves every value as the characters it already was, because nothing is parsing them as numbers or dates on the way in. If the work genuinely has to happen in a workbook, convert the CSV to Excel rather than double-clicking it, so each column arrives as a written cell value instead of something Excel guessed a type for.
Replacing inside formulas without meaning to. Because the Replace tab writes to Formulas [1], a search for A5 will rewrite references in every formula containing it. That is a deliberate feature for repointing a model, and a bad accident when you meant to fix a text label.
The habit that prevents all four: work on a copy, narrow the scope to a selection, run Find All to see the count, then replace.
Replace the characters you cannot type
The worst offenders in a fresh export are often characters with no key on the keyboard: line breaks inside cells, non-breaking spaces from a web page, and values that differ only by formatting. Find and Replace handles all three once you know how to enter them.
Line breaks inside a cell. A cell holds several lines because Alt+Enter — Control+Option+Return on a Mac — inserts a line break where the cursor sits [5]. Those breaks survive into a CSV export, where they split one record across several rows and the importer rejects the file. To clear them, click into the Find what box and press Ctrl+J. The box still looks empty, but it now holds the line-feed character. Leave Replace with blank to delete the breaks, or type one space to keep the words apart. Press Ctrl+J once only — a second press stacks two characters and the search stops matching anything.
Non-breaking spaces. Text pasted from a browser carries character 160, which looks like a space and behaves like one to the eye, but TRIM leaves it alone. In the Find what box, hold Alt and type 0160 on the numeric keypad, then replace it with a normal space. The walkthrough of TRIM and the spaces it misses covers why this one character defeats the usual cleanup.
Values that differ only in format. Find and Replace can match on appearance rather than content. Select Format, then "make your selections in the Find Format dialog box" [1]. Microsoft also notes you can "delete any criteria in the Find what box, and then select a specific cell format as an example" [1] — which is how you strip a stray fill colour or a currency format applied to only some rows. Clear the format criteria when you are done, because Excel remembers them and the next plain search will report no matches on text that is plainly there.
Do the same swap on a CSV without Excel
If the file is a CSV and its destination is an importer rather than a spreadsheet, Excel is a detour that adds risk.
A CSV file is plain text. Nothing in it needs a formula engine, and every conversion Excel applies on open — dates, scientific notation, dropped leading zeros — is a change you did not ask for. Sigmera's find and replace tool for CSV files works on the text directly: pick a column, set match case or whole-cell matching, see the affected rows before you commit, and download the corrected file. It runs entirely in your browser, so a file full of customer names and phone numbers never reaches a server and stays GDPR-safe by default. Phone columns are the common case where find-and-replace stops being enough: stripping dashes and brackets one pattern at a time still leaves you without country codes, so reach for a dedicated phone number formatter instead of chaining replacements. Each of those jobs has its own tool in the same browser-based data cleaning software, and none of them ask you to upload the file first.
Order matters if the file needs more than one fix. Replace stray characters first, standardise formats next, and deduplicate last — matching two spellings of the same record only works after both have been normalised. If that last pass is the one you are stuck on, how to remove duplicates in Excel walks through the Data-tab dialog and the COUNTIF formulas that flag repeats before you delete them. For a file that never needs to enter a spreadsheet at all, the CSV duplicate remover does the same job on the raw export and shows the flagged rows before anything is dropped. The rest of the data cleansing tools follow the same in-browser model, and previewing every result is free and unlimited; the download counter only ticks when you export the finished file.
Sources
Frequently asked questions
- What is the shortcut for Find and Replace in Excel?
- Ctrl+H opens the Replace tab on Windows, and Ctrl+F opens Find. On a Mac, Microsoft documents Control+F or Command+F for Find and Control+H for Replace. You can also reach it from Home > Editing > Find & Select > Replace.
- How do I find and replace in one column only?
- Select the column (or the exact range) before you press Ctrl+H. Excel limits the search to the highlighted cells, so a replacement cannot escape into a neighbouring column. With no selection, the scope falls back to the whole sheet, and the Within box can widen it further to the entire workbook.
- Can I use wildcards in Excel Find and Replace?
- Yes. A question mark matches any single character, so sm?th finds both smith and smyth. An asterisk matches any number of characters, so *east finds Northeast and Southeast. Microsoft documents both for Excel's Find and Replace, text filters, and conditional formatting rules.
- How do I search for a literal asterisk or question mark?
- Put a tilde in front of it. Typing fy06~? finds the text fy06? rather than treating the question mark as a wildcard, and ~* finds a real asterisk. The same escape works for a tilde itself, written as ~~.
- Does Excel Find and Replace support regular expressions?
- No. Excel's dialog offers wildcards, Match case, Match entire cell contents, and format matching, but no regex option. Google Sheets does — its find and replace has a "Search using regular expressions" checkbox built on RE2 syntax, which is the closest spreadsheet equivalent to a pattern-based replace.
- Can I undo Replace All in Excel?
- Ctrl+Z reverses a Replace All as a single step while the workbook is still open. Once you save, close, and reopen the file, the undo history is gone and the old values are unrecoverable. On an irreplaceable export, work on a copy instead of relying on undo.
- How do I find and replace in a CSV without opening Excel?
- Use a browser-based find-and-replace tool that reads the CSV as plain text. It skips Excel's automatic conversion of long numbers and date-like values, and with Sigmera the file is processed in the browser tab, so it never uploads to a server.
- How do I find and replace a line break in Excel?
- Click into the Find what box and press Ctrl+J. The box still looks empty, but it now holds the line-feed character that Alt+Enter inserts inside a cell. Leave Replace with blank to delete the breaks, or type a single space to keep the words separated. Press Ctrl+J once only — a second press stacks two characters and nothing matches.
- Why does Excel say it cannot find something that is clearly in the sheet?
- Three settings cause this. A format criterion left over from an earlier search restricts the match to cells with that formatting, so clear it from the Find Format dialog. Match entire cell contents rejects any partial match. And the Look in box may be set to Values while the text lives in a formula, or set to Formulas while you are hunting a calculated result. Check all three before assuming the value is absent.