How to Find And Replace Multiple Values in Excel

Learn multiple Excel methods to find and replace multiple values with step-by-step examples and practical applications.

excelformulaspreadsheettutorial
12 min read • Last updated: 7/2/2025

How to Find And Replace Multiple Values in Excel

Why This Task Matters in Excel

Every analyst eventually confronts a messy worksheet filled with inconsistent codes, outdated product names, or legacy department IDs. Replacing a single value is trivial—press Ctrl + H, type the old value, enter the new value, and click Replace All. But what happens when you must swap dozens or hundreds of values at once? Manually repeating that dialog is slow, error-prone, and impossible to audit later.

Consider a retail company that recently rebranded its product lines. The old data uses labels like “Classic-01” and “Classic-02” while marketing insists the reports show “Heritage-01” and “Heritage-02.” At the same time, outdated currency codes (BEF, ATS, ESP) need to become EUR, and placeholder blanks must turn into “N/A.” Without a reliable bulk replacement strategy, every weekly dashboard risks inconsistency—and the analyst spends hours double-checking reports rather than interpreting results.

Industries from finance (merging ticker symbols after acquisitions) to healthcare (mapping diagnostic codes) to manufacturing (substituting component IDs when suppliers change) all face the same challenge. In many of these settings, Excel remains the first or last mile of data transformation because of its flexibility, low barrier to entry, and ubiquity across departments. Mastering multi-value find-and-replace therefore saves time, reduces manual errors, and prevents misaligned KPIs that can lead to costly business decisions.

Excel offers several complementary approaches:

  • A lookup table combined with XLOOKUP, VLOOKUP, or INDEX + MATCH for exact replacements
  • SWITCH or nested IFS for short replacement lists embedded directly in a formula
  • SUBSTITUTE, possibly repeated or wrapped in REDUCE + LAMBDA, when you must replace multiple substrings inside longer text strings
  • Power Query’s Replacer.ReplaceValue step for point-and-click transformations on large tables
  • And of course, VBA macros or Office Scripts for fully automated batch operations

Choosing the best technique depends on data size, number of replacement pairs, need for transparency, and whether the replaced values should remain dynamic (update automatically when the mapping table changes) or become permanent.

Ignoring this skill can lead to inconsistent reporting, hours of manual rework, and poor data governance. On the other hand, learning a systematic approach to bulk replacement strengthens your overall Excel toolkit—lookups, dynamic arrays, data modeling—and lays the groundwork for more advanced automation.

Best Excel Approach

When your goal is transparent, scalable, and re-usable replacement, the strongest option is a lookup-table solution. You create a two-column mapping table—one column for “Find” values, the second for “Replace With” values—then use XLOOKUP (or VLOOKUP/INDEX + MATCH in older versions) to translate every cell dynamically. Because the mapping resides in a visible sheet, stakeholders can audit and edit replacements without touching formulas.

Syntax with XLOOKUP:

=XLOOKUP(A2, Mapping[Find], Mapping[Replace], A2)
  • A2 – value you want to check
  • Mapping[Find] – first column of the mapping table (old values)
  • Mapping[Replace] – second column (new values)
  • A2 (fourth argument) – fallback when no match is found, effectively leaving the original value untouched

Why choose this method?

  1. Handles hundreds or thousands of pairs effortlessly
  2. Edits update immediately—change the mapping once, all linked formulas recalculate
  3. Preserves original data; you can compare “before” and “after” or roll back changes
  4. Requires no coding and minimal advanced knowledge beyond basic lookups

Use it when:

  • Your replacement list is more than three to five pairs
  • Transparency and auditability matter
  • You want dynamic updates instead of permanent overwriting

Alternatives excel when you have embedded substrings, need irreversible hard-coded changes, or must process millions of rows outside Excel’s native limits.

Parameters and Inputs

Before writing formulas or launching Power Query, confirm the following inputs:

  • Source Range – cells that contain the values to evaluate. They can be numbers, codes, or full sentences. Ensure there are no leading/trailing spaces unless they are deliberate.
  • Mapping Table – exactly two columns: [Find] and [Replace With]. Both columns should be the same data type as the source (all text or all numbers). Sorting is optional for XLOOKUP but required for VLOOKUP in approximate-match mode.
  • Worksheet Scope – Decide whether the mapping lives on the same sheet, a hidden sheet, or an external workbook. Cross-workbook links require stable file paths.
  • Headers – Include clear header labels in your mapping table to facilitate structured referencing (e.g., Mapping[Find]).
  • Fallback Rule – What should happen if a value does not appear in the Find column? Most users keep the original value, but you might prefer “Unknown” or a blank string.
  • Edge Cases – Duplicate keys in the Find column, case sensitivity (Excel lookups are case-insensitive), numbers stored as text, or possible circular references if the mapping table references the same cells it transforms.

Pre-validate your mapping with Data Validation or conditional formatting that highlights blanks or duplicates to avoid cryptic lookup errors later.

Step-by-Step Examples

Example 1: Basic Scenario – Updating Department Codes

Imagine a small HR dataset listing department codes in column A. Codes “FIN,” “HR,” and “R&D” must become “Finance,” “Human Resources,” and “Research & Development.”

  1. Create a Mapping Table
    In [E1:F4], type:

    • [E2] FIN → [F2] Finance
    • [E3] HR → [F3] Human Resources
    • [E4] R&D → [F4] Research & Development
      Name the table “Mapping” with headers Find and Replace.
  2. Write the Formula
    In [B2]:

    =XLOOKUP(A2, Mapping[Find], Mapping[Replace], A2)
    

    Fill down to the last row. Each code instantly expands to its full name.

  3. Why It Works
    XLOOKUP searches for the exact code in the Find column. When found, it returns the adjacent cell from Replace With. Missing codes flow through unchanged because of the fourth argument (A2).

  4. Variations

    • Switch to VLOOKUP(A2,Mapping,2,0) in pre-365 Excel.
    • If case sensitivity matters, wrap both lookup_value and lookup_array inside EXACT within a FILTER.
  5. Troubleshooting

    • #N/A error: check for leading/trailing spaces or mismatched data types.
    • Duplication: if “FIN” appears twice in the Find column, XLOOKUP returns the first match; consolidate duplicates.

Example 2: Real-World Application – Bulk Currency Code Conversion

A finance team receives a 5 000-row transactions list with legacy European currencies. They must convert BEF, ATS, DEM, ESP, and ITL to EUR and calculate euro amounts.

  1. Context
    Column B = Currency Code, Column C = Local Amount. Marketing expects a unified euro column in the month-end dashboard.

  2. Mapping Table
    On a separate sheet “Ref,” create table [Ref!A1:B6]:
    Headers: OldCurrency | NewCurrency
    Data: BEF, ATS, DEM, ESP, ITL mapped to EUR.
    Add a second table [Ref!D1:E6] for conversion rates if needed.

  3. Dynamic Replacement
    In [D2] on the main sheet:

    =XLOOKUP(B2, Ref!OldCurrency, Ref!NewCurrency, B2)
    

    Fill down to produce a cleaned Currency column.

  4. Calculate Euro Amount

    =C2 * XLOOKUP(B2, Ref!OldCurrency, Ref!Rate, 1)
    

    Where Ref!Rate holds numeric rates. The formula multiplies the local amount by the matching rate; if code already equals EUR, the fallback rate 1 keeps it unchanged.

  5. Integration

    • Conditional formatting highlights any currency not equal to “EUR” after replacement.
    • A pivot table groups by NewCurrency to confirm no legacy codes remain.
  6. Performance
    XLOOKUP on 5 000 rows recalculates in milliseconds. For 50 000 + rows, turn off automatic calculation while pasting large data or switch to Power Query.

Example 3: Advanced Technique – Replacing Multiple Substrings Inside Product Descriptions

Suppose product descriptions contain “LCD-TV,” “LED-TV,” and “CRT-TV,” plus rogue abbreviations “Ref.” instead of “Refurbished.” Marketing wants:

  • LCD-TV → LCD Television
  • LED-TV → LED Television
  • CRT-TV → CRT Television
  • Ref. → Refurbished

Here, each cell contains longer text, so we must replace substrings, not entire cells.

  1. Mapping Pairs
    Table [G1:H5] labeled OldText / NewText with the four pairs above.

  2. Lambda Helper – SUB_MULTI
    In [Name Manager] create:

    =LAMBDA(text, old, new,
        REDUCE(text,
            SEQUENCE(ROWS(old)),
            LAMBDA(acc,i,
                SUBSTITUTE(acc, INDEX(old,i), INDEX(new,i))
            )
        )
    )
    

    This function loops through each old/new pair and applies SUBSTITUTE sequentially.

  3. Apply the Lambda
    In [B2] next to the raw description:

    =SUB_MULTI(A2, G2:G5, H2:H5)
    

    Result: “32” LED Television Refurbished” becomes “32” LED Television Refurbished.”

  4. Why This Works
    REDUCE iterates an array [1,2,3,4] representing each mapping row. The accumulator acc starts as the original description. On each pass, SUBSTITUTE swaps one substring, and the output feeds the next pass.

  5. Edge Cases & Optimization

    • Order matters. Replace longer phrases first to avoid partial overlaps.
    • For hundreds of pairs, performance may lag. In that case, move to Power Query’s Replace Values transformation, which compiles replacements into a single operation.
  6. Professional Tips

    • Document the lambda in a hidden helper sheet for maintainability.
    • Add a quick test column that flags cells containing any unmapped abbreviations using TEXTJOIN + SEARCH inside an IF.

Tips and Best Practices

  1. Keep the Mapping Table Visible and Sorted – Stakeholders can scan, filter, and edit replacements without touching formulas.
  2. Use Structured References – Instead of traditional [A2:B50], reference Mapping[Find] to avoid broken formulas when the table expands.
  3. Fallbacks Matter – Provide a sensible default (original value or “Unknown”) so new codes do not break your reports with #N/A errors.
  4. Turn Off Calculation When Bulk Pasting – For very large datasets, set calculation to Manual before pasting, then recalc once to save time.
  5. Audit with Conditional Formatting – Shade any cell whose cleaned value equals the original value when a replacement was expected.
  6. Document Changes – Add a comment or dedicated sheet explaining the logic. Future analysts can trace why “Legacy X” became “Modern Y.”

Common Mistakes to Avoid

  1. Hard-coding Replacement Lists in Nested IFs – It works for two or three items but becomes unmanageable quickly. Convert to a mapping table early.
  2. Forgetting Data Type Consistency – Numbers stored as text in the source will not match numeric entries in the mapping. Wrap both columns in TEXT or VALUE consistently.
  3. Overwriting Raw Data – Running Replace All without a backup eliminates your ability to audit or undo changes. Always output to a new column or copy of the sheet.
  4. Duplicated Keys in the Find Column – XLOOKUP returns the first match, which may be unpredictable. Use Remove Duplicates or COUNTIFS to enforce uniqueness.
  5. Ignoring Case Sensitivity When It Matters – Standard lookups ignore case. If “abc” and “ABC” must map differently, use EXACT inside FILTER or shift to Power Query, which can do case-sensitive replacements.

Alternative Methods

MethodProsConsBest For
Find & Replace dialog (Ctrl + H)Fast for 1-3 replacements, no formulasManual, irreversible, no audit trailOne-off quick fixes
Nested SUBSTITUTEWorks inside longer strings, no helper table neededGets unwieldy, order-sensitiveShort substring lists
SWITCH / IFSSimple syntax for fewer than 127 pairsFormula becomes long, hard to editSmall static maps
XLOOKUP with Mapping TableDynamic, scalable, auditableRequires helper tableMost business cases
Power Query Replace ValuesHandles millions of rows, case-sensitive option, UI drivenData ends in Power Query table, not worksheet cells by defaultLarge ETL pipelines
VBA / Office ScriptFully automated across workbooks, can prompt userRequires coding, macro securityRepeated batch jobs

Choose XLOOKUP by default when you need transparency. Move to Power Query if the dataset exceeds a few hundred thousand rows or you need an end-to-end transformation pipeline. Pick VBA when non-technical users must click a button to re-run replacements across multiple files.

FAQ

When should I use this approach?

Use the mapping-table lookup approach when you have more than a handful of replacements, require transparent rules, and expect the list to evolve. It excels in recurring reports, regulatory code changes, or any process that benefits from a clear audit trail.

Can this work across multiple sheets?

Yes. Place the mapping table on a central sheet like “Ref” and refer to it from any other sheet:

=XLOOKUP(A2, Ref!Find, Ref!Replace, A2)

Just ensure the mapping sheet remains in the workbook or in a linked workbook with an accessible path.

What are the limitations?

Standard lookups are case-insensitive and only handle exact matches. They cannot replace substrings inside longer text (use SUBSTITUTE or Power Query). Excel’s row cap (1 048 576) also limits gigantic datasets, although Power Query can load from external sources and preview within Excel.

How do I handle errors?

Wrap XLOOKUP in IFERROR to capture unexpected #VALUE! or #REF! issues. Use conditional formatting to highlight #N/A before resorting to global suppressions—errors often flag missing mapping pairs that should be added.

Does this work in older Excel versions?

Pre-2019 versions lack XLOOKUP. Substitute VLOOKUP or INDEX + MATCH:

=IFERROR(VLOOKUP(A2, Mapping, 2, FALSE), A2)

Dynamic arrays and LAMBDA require Microsoft 365. Power Query (Get & Transform) exists in Excel 2010 onward via the free add-in or built-in from 2016.

What about performance with large datasets?

On tens of thousands of rows, XLOOKUP remains fast. For hundreds of thousands or when formulas stack heavily, switch calculation to Manual while editing. For millions of rows, move to Power Query or import into a database engine (Access, SQL, Power BI) that can handle columnar operations more efficiently.

Conclusion

Knowing how to find and replace multiple values transforms Excel from a manual editing tool into a lightweight data transformation engine. Whether you adopt a simple mapping table with XLOOKUP, craft a dynamic REDUCE + SUBSTITUTE lambda, or leverage Power Query, you gain speed, accuracy, and transparency. These techniques dovetail with broader Excel skills—structured references, dynamic arrays, and data modeling—so mastering them paves the way toward professional-grade analytics. Experiment with the examples, adapt them to your data, and you will spend less time cleansing and more time extracting insights.

We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve.