Find and Replace Numbers in Excel: A Practical Guide

How-to basics · Updated November 3, 2026

Find and Replace Numbers in Excel: A Practical Guide

To find and replace numbers in Excel for Microsoft 365 on Windows, press Ctrl+H, enter the number in Find what, enter its replacement in Replace with, choose the search scope, then select Replace or Replace All. Check the matching cells first: a search for one digit can also change larger numbers, IDs, formulas, or text if the match is not limited to a whole cell.

What Find and Replace changes

Excel’s Find and Replace tool searches cell contents and applies a replacement to matches. It is useful for a deliberate, consistent change, such as changing a department code from 31 to 32 across a sheet. It is not the same as finding a number visually: cells can display rounded values, dates, or formatted numbers that differ from the underlying value or formula.

The key choice is whether you intend to replace a complete cell value or a sequence of characters within it. For example, replacing 1 with 9 could turn 1 into 9, but it might also change 14 to 94 or the text ID A-101 into A-909, depending on the search settings and matching content. A broad replacement can therefore be technically successful while changing data you meant to keep.

Find and Replace edits the workbook; it does not create a separate result column for review. Before a large replacement, save a copy or use Undo immediately if the result is wrong. Ctrl+Z can undo a normal replacement, but it may not be available after closing the workbook or performing certain other actions.

Replace numbers with Ctrl+H

  1. Select the cells you want to search. If you select a range, Excel limits the operation to that selection; if you do not, it searches the applicable sheet or workbook.
  2. Press Ctrl+H on Windows, or use Home > Find & Select > Replace. In the dialog, open the Replace tab if it is not already selected.
  3. Type the target in Find what and the new content in Replace with. For example, to change whole-cell values of 31 to 32, enter 31 and 32 respectively.
  4. Select Options to review the search settings. Set Within to Sheet or Workbook as appropriate, and check Look in and Match entire cell contents before replacing.
  5. Choose Find All to inspect matches, or Find Next to review them one at a time. Use Replace to change the current match or Replace All to change every match in the selected scope.
  6. Read Excel’s replacement count, then inspect the affected cells and nearby data. If the result is not what you intended, press Ctrl+Z before making further changes.

On Excel for Mac, Control+H opens Replace in current desktop versions; if the shortcut behaves differently on a particular keyboard, use Home > Find & Select > Replace. Excel for the web has a different interface and browser shortcuts can interfere, so use the ribbon’s Find and Replace controls if the keyboard shortcut opens a browser feature instead.

Choose the right search scope and options

Scope is one of the most important safeguards. Within: Sheet searches the current worksheet, while Within: Workbook searches across worksheets. A workbook-wide replacement can affect hidden sheets as well as visible ones, so confirm the scope rather than assuming Excel is searching only the tab in front of you. Selecting a range first is another way to limit the operation, but still review the scope setting.

Look in determines what Excel searches. Formulas searches formula text, such as the digits inside a formula. Values searches calculated or displayed cell results rather than the formula expression. If your goal is to change a formula’s result, editing the source data or formula is usually clearer than replacing text in formulas. Be especially cautious when replacing in cells that contain formulas: a replacement can alter a formula or replace its contents, depending on what is matched.

Match entire cell contents is useful when the intended target is a complete cell value. With this option selected, a search for 31 is not meant to match a cell containing 310 or the text ID31. Without it, Excel can find a digit sequence inside a longer entry. Search direction and Match case are available options too, although capitalization does not affect numeric digits. Any settings left from an earlier search can affect the next one, so check them each time.

Whole-cell matches versus digits inside numbers

Decide whether you are replacing a number as a value or a digit pattern. If a column contains product codes and you want to change only the complete code 31, match the entire cell contents. If your purpose is specifically to change every occurrence of the digit 1 in text, a partial match may be appropriate—but review whether codes such as 101 or 210 should change too.

For example, suppose a sheet contains the numeric values 1, 10, and 21. A search for 1 without whole-cell matching may find the digit in more than one entry. A search for 1 with Match entire cell contents is intended to limit the match to a cell whose complete content is 1. Use Find All first when the result could affect identifiers, account references, postal codes, or other values where each digit matters.

Excel’s Find and Replace dialog does not provide a general regular-expression mode. Wildcard characters such as an asterisk and question mark can be used in Excel searches for pattern matching, but they are not a substitute for carefully defining a numeric rule. If the rule is “replace values from 100 through 199” or “change only records meeting a condition,” use a filter, helper formula, or another explicit method instead of a broad digit replacement.

Numbers, text, formulas, and displayed values

A cell that looks numeric may contain a number or text made of digits. For instance, a value such as 00427 is often stored as text to preserve its leading zeros. Replacing its contents can affect whether the result remains text, and converting it to a number may remove those zeros. For codes and identifiers, check the cell’s data type and number format before and after the operation.

Formatting also changes what you see without necessarily changing the stored value. A cell containing 12.345 might display as 12.35 with two decimal places. A date is stored as a serial number and shown using a date format. Searching for the displayed date or rounded number may not behave like searching for the underlying stored value. If an intended match is missing, inspect the formula bar and the cell’s number format rather than assuming the data itself is wrong.

Formula cells need particular care. A formula such as =A2*10 contains the digits 10 in its expression, while its calculated result may be a different number. Searching formulas can target the expression; searching values concerns the calculated result. If you mean to change a factor used by many formulas, editing the input cell or a clearly identified constant is often safer and easier to audit than replacing a digit throughout formula text.

Safer alternatives for conditional or reviewable changes

Use a helper column when you need to inspect the proposed result before replacing original data. For example, with source values in A2:A100 and a new result column in B, enter this in B2 and fill down:

=IF(A2=31,32,A2)

This formula returns 32 when A2 is exactly 31 and otherwise returns A2. If A2 contains 310, the result remains 310. Once you have checked the output, copy the results and use Paste Special > Values if you want to replace the original cells with fixed values. Keep a backup first, especially if the source column contains mixed data types or formulas.

For text where a particular substring should be changed, a helper formula can make the rule visible. With text in A2, this formula replaces every occurrence of the character 1 with 9:

=SUBSTITUTE(A2,"1","9")

For example, if A2 contains INV-1041, the result is INV-9049. SUBSTITUTE returns text, even when the source looks numeric, so this approach is best for text values such as codes. If the desired result must be a number, check and convert it deliberately rather than assuming a text result will work in later calculations.

Filters are another good choice when replacement depends on a condition, such as changing values only for rows belonging to one region. Filter the relevant table column, select the visible target cells, and replace only after confirming the selection and scope. Conditional formulas are preferable when the transformation must remain dynamic as source data changes.

Common problems and how to avoid them

  • Too many cells changed: The search probably matched part of a longer value or the scope was broader than expected. Undo, narrow the selection, enable Match entire cell contents when appropriate, and use Find All before replacing again.
  • No matches appear: Check for a different stored value, a text-versus-number difference, a formula result, or an unexpected Look in setting. A displayed rounded value or formatted date may not be the content you need to search for.
  • Formulas changed unexpectedly: Look in may have been set to Formulas, or the replacement may have affected formula text. Undo and search a limited range after inspecting the formulas. Avoid replacing common digits in a workbook’s formulas.
  • Leading zeros disappeared: The result may have been converted to a number or displayed with a different format. Keep identifiers as text when their zeros are meaningful, and verify the stored contents rather than relying only on appearance.
  • Only one sheet changed: The Within setting may be Sheet. Choose Workbook only when you intend to search all worksheets, and verify the replacement count and results across the relevant tabs.

Frequently Asked Questions

How do I replace a number in Excel without changing larger numbers?
Open Ctrl+H, select Options, and turn on Match entire cell contents when the target must be the complete cell value. Use Find All to check the matches before selecting Replace All.

Can Excel replace numbers across every sheet?
Yes. In the Replace dialog, set Within to Workbook rather than Sheet. Confirm the workbook-wide scope and inspect the results, because the replacement may affect hidden or unrelated worksheets.

Can I replace a number in formulas without changing the displayed result only?
Find and Replace is not a display-only formatting tool. Searching formula text can change the formula expression; searching values is different from editing the expression. For a controlled formula change, identify and edit the relevant inputs or formulas directly.

Why does Find and Replace miss a number I can see?
The visible number may be rounded, formatted as a date, produced by a formula, or stored as text. Check the formula bar, the Look in option, and the cell’s number format to identify what Excel is actually searching.

How can I replace only one exact numeric value in a range?
Select the range, use Ctrl+H, enable Match entire cell contents, and search for the value. Review Find All results first. For a rule that depends on conditions, a helper formula such as IF is more explicit.

Can I undo Replace All?
Usually, Ctrl+Z on Windows undoes a recent Replace All operation, and Command+Z is the Mac equivalent. Undo promptly, before closing the workbook or performing actions that disrupt the undo history; saving a backup is the safer precaution.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.