Sigmera.

excel

How to Find and Replace in Excel Without Errors

Sigmera Team8 min read

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.

OptionWhat it doesReach for it when
Match caseMakes the search case-sensitive [1]Fixing ACME without touching Acme
Match entire cell contentsOnly matches cells equal to the whole search string [1]Replacing NA without hitting NAME or Canada
Look in: Formulas / ValuesSearches cell contents or displayed results [1]Rewriting a cell reference across many formulas
Format / Choose Format From CellMatches 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?th finds smith and smyth [2]
  • *east finds 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.

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.

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.

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.

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.

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. 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

  1. 1.Find or replace text and numbers on a worksheet
  2. 2.Using wildcard characters in searches
  3. 3.SUBSTITUTE function
  4. 4.Edit and format a spreadsheet — find and replace

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.

Keep reading