Skip to content
ArumSoft Learning
KO

    Everyday Excel Skills · Tutorial 5 of 14

    How to Use Find and Replace in Excel

    Find any value on a sheet or in a whole workbook, change every copy of it at once, and use options and wildcards so you replace only what you mean to.

    Level
    Beginner
    Time
    9 min read
    Updated:
    Applies to:
    Excel for Microsoft 365, Excel 2021, Excel 2019, Excel for the web
    The order list. The three notebook codes to change are amber; A-100 and A-105 (red) also contain the text A-10.
    Example: The order list. The three notebook codes to change are amber; A-100 and A-105 (red) also contain the text A-10.

    What you'll learn

    • Open Find and Replace from the ribbon or with Ctrl+F and Ctrl+H
    • Replace every copy of a value in one step without changing similar values
    • Use Match case, Match entire cell contents and Within to control what gets changed
    • Find text with the * and ? wildcards, and find a real asterisk with ~
    • List every match with Find All and select them all at once

    Find and Replace looks for a word, number or code in your cells and, if you want, changes every copy of it in one go. Use it when a product code changes, when a name is spelled two ways, or when you need to know where a value appears in a long sheet. Press Ctrl+F to find and Ctrl+H to replace.

    Where to find it

    Both commands are in the Find & Select menu in the Editing group of the Home tab.

    Home › Editing › Find & Select › Replace opens the Find and Replace dialog on its Replace tab.
    • Home then Editing then Find & Select then Find or Ctrl+F opens the Find and Replace dialog on the Find tab.
    • Home then Editing then Find & Select then Replace or Ctrl+H opens it on the Replace tab.

    The dialog has both tabs, so you can switch between finding and replacing without closing it. After you close it, Shift+F4 finds the next match of your last search.

    Replace one value with another

    A supplier has changed the code for notebooks from A-10 to N-10, and the order list below uses the old code three times. There's a trap: the codes A-100 and A-105 both contain "A-10".

    ABCD
    1OrderCodeItemQty
    21,001A-10Notebook12
    31,002A-100Stapler3
    41,003C-20Pen40
    51,004A-10Notebook8
    61,005A-105Scissors5
    71,006C-20Pen25
    81,007A-10Notebook6
    The order list. The three notebook codes to change are amber; A-100 and A-105 (red) also contain the text A-10.
    1. Select where to search

      Click one cell to search the whole sheet, or select a range to search only inside it. Here, select B2:B8 so nothing outside the Code column can change.

    2. Open the Replace tab

      Press Ctrl+H. Type A-10 in Find what and N-10 in Replace with.

    3. Show the options

      Click Options to expand the dialog, then tick Match entire cell contents. Now a cell matches only if it holds exactly "A-10" and nothing else.

      The Replace tab after clicking Options: Match entire cell contents is ticked, so A-100 and A-105 are left alone.
    4. Replace them all

      Click Replace All. Excel tells you how many replacements it made: 3. Click OK, then Close.

      ABCD
      1OrderCodeItemQty
      21,001N-10Notebook12
      31,002A-100Stapler3
      41,003C-20Pen40
      51,004N-10Notebook8
      61,005A-105Scissors5
      71,006C-20Pen25
      81,007N-10Notebook6
      After Replace All with Match entire cell contents: only the three notebook rows changed.

    Without Match entire cell contents, Excel replaces "A-10" wherever it appears inside a cell. You'd get 5 replacements, and two of them are wrong:

    ABCD
    1OrderCodeItemQty
    21,001N-10Notebook12
    31,002N-100Stapler3
    41,003C-20Pen40
    51,004N-10Notebook8
    61,005N-105Scissors5
    71,006C-20Pen25
    81,007N-10Notebook6
    The same Replace All without Match entire cell contents: A-100 became N-100 and A-105 became N-105.

    If that happens, press Ctrl+Z straight away to undo the whole Replace All, then try again with the option ticked.

    To check before you change anything, use Replace instead of Replace All. Click Find Next to go to the first match, then Replace to change it and move to the next one; click Find Next to skip one you want to keep.

    The options, one by one

    Click Options to see them. Excel remembers your choices until you close Excel, so check them each time you open the dialog.

    OptionWhat it does
    WithinSheet searches the active sheet; Workbook searches every sheet in the file.
    SearchBy Rows or By Columns: the order in which Find Next moves through the matches. It doesn't change which cells match.
    Look inFormulas searches what's typed in each cell, including the text of formulas. Values searches the results you see. On the Replace tab, Excel always searches formulas.
    Match case"Ana" no longer matches "ANA" or "ana".
    Match entire cell contentsMatches only cells that contain exactly what you typed, nothing more.
    FormatFinds cells by their formatting, such as a fill color, and on the Replace tab can give the replaced cells a new format.

    Look in matters for numbers. If D9 holds =SUM(D2:D8) and shows 99, searching for 99 with Look in: Formulas doesn't find it, because the cell contains a formula, not 99. Switch to Look in: Values on the Find tab and it does.

    Wildcards: * and ?

    Two characters in Find what stand for other characters:

    • ? stands for any one character. Sm?th finds Smith and Smyth.
    • * stands for any number of characters, including none. North* finds North, Northeast and North Coast.

    Combined with Match entire cell contents, *Ltd finds only cells that end in "Ltd".

    To find a real *, ? or ~, put a tilde in front of it: ~* finds an asterisk, ~? a question mark.

    Find every match at once with Find All

    Find Next jumps to one match at a time. Find All lists them all at the bottom of the dialog, with the sheet, cell, value and formula for each one, and the number of cells found underneath.

    • Click a row in the list to go to that cell.
    • Click in the list and press Ctrl+A to select every found cell on the sheet. Close the dialog, and they stay selected, ready for a fill color, bold, or a new value typed and entered with Ctrl+Enter.

    Real-world scenarios

    Work

    A department changes its name

    Customer Care is now called Client Services, and the name appears on several sheets of the staff workbook.

    ABC
    1NameDepartmentExt.
    2Maya BrooksCustomer Care214
    3Leo GrantFinance230
    4Iris KempCustomer Care216
    5Owen PriceSales241
    6Nadia ShahCustomer Care219
    One of the staff sheets. The three Customer Care cells need the new name.

    Press Ctrl+H, type Customer Care in Find what and Client Services in Replace with. Click Options, set Within to Workbook and tick Match entire cell contents, then click Replace All. Every sheet is updated in one step, and a cell such as "Customer Care training" in a notes column is left alone.

    School

    Highlight every absence

    A teacher wants every absence in the attendance sheet to stand out before a parents' evening.

    ABCDE
    1StudentMonTueWedThu
    2AidenAbsent
    3Bella
    4CalebAbsentAbsent
    5DaisyLate
    6EthanAbsent
    A week of attendance. Find All finds the four Absent cells, and Ctrl+A selects them.

    Press Ctrl+F, type Absent and click Find All. The list shows 4 cells found. Press Ctrl+A while the list is active, close the dialog and click Fill Color on the Home tab. All four cells are colored at once; the Late cell in D5 isn't touched.

    Budget

    Remove the pending marks from a bank export

    A bank export marks pending payments with an asterisk at the end of the description. Before you sort and total, the marks have to go.

    ABC
    1DateDescriptionAmount
    22026-09-01Groceries64.2
    32026-09-02Bus pass30
    42026-09-04Gas48.75
    52026-09-05Phone bill45
    62026-09-06Pharmacy12.4
    After replacing ~* with nothing: Groceries, Gas and Pharmacy lost their asterisks, and nothing else changed.

    Select B2:B6, press Ctrl+H, type ~* in Find what, leave Replace with empty and click Replace All. Excel removes the three asterisks. Typing * without the tilde would match every cell and replace each description with nothing.

    Common mistakes

    • Replacing part of a longer value. Replacing "A-10" also changes "A-100" unless Match entire cell contents is ticked. Undo with Ctrl+Z and tick it.
    • Changing formulas by accident. The Replace tab searches the text of formulas too. Replacing "B" with "C" in a selection that includes =SUM(B2:B8) turns it into =SUM(C2:C8). Select only the cells you mean to change.
    • Options left over from last time. Within: Workbook or Match case stay switched on after you use them. If Replace finds too much or nothing at all, open Options and check them.
    • "We couldn't find what you were looking for." Check for a leftover option, extra spaces in Find what, or a number that is really a formula result (try Look in: Values on the Find tab).
    • An asterisk that replaces everything. * is a wildcard. To find the character itself, type ~*.

    Practice

    Practice

    Clean up a list with Find and Replace

    Type the order list from the top of this page into a new sheet (or use a list of your own with a code column).

    1. Select the Code column and replace A-10 with N-10 without ticking Match entire cell contents. How many replacements did Excel make? Press Ctrl+Z.
    2. Do it again with Match entire cell contents ticked. Check that A-100 and A-105 didn't change.
    3. Use Find All to list every cell that contains "Pen", then select them all with Ctrl+A and make them bold.
    4. Type Tape* in an empty cell, then use ~* to remove the asterisk.
    5. Add a second sheet with one more A-10 order, and replace the code on both sheets at once with Within: Workbook.

    Related

    Was this guide helpful? Spot a mistake? Send feedback · admin@arumsoft.com