Hi - Dave here.
Happy Friday!
There is no built-in function to perform a series of find and replace operations in Excel, but you can create a formula that does the same thing.
You can see the basic concept in the worksheet below, where the goal is to replace multiple ("find") values with corresponding ("replace") values in a single "replace all" operation. The formula in cell D5 looks like this:
=LET(
range,B5:B16,
find,F5:F9,
replace,G5:G9,
ix,SEQUENCE(ROWS(find)),
result,REDUCE(range,ix,LAMBDA(a,i,
SUBSTITUTE(a,INDEX(find,i),INDEX(replace,i))
)),
TRIM(result)
)
[ Download the workbook and read the full explanation]
This is a tricky formula! In a nutshell, it runs through the values in B5:B16 one at a time. Then, for each value, it loops over the five find/replace pairs in G5:G9 and performs a "replace all" with each. The final modified values in column D are returned with a single formula. See the article for a full teardown. I also explain how to adapt the formula to use regex and how to define it as a custom function you can call like a regular Excel function.
Note: The formula above requires Excel 365 or 2024. I also include a more limited formula that will work in older versions of Excel.
Excel formulas
We maintain a list of over 1000 working formulas here.
If you need more structure, we also offer video training.
Have a great weekend!
Dave
The Exceljet newsletter is free and sent weekly on Fridays. Each week, I take a detailed look at a specific Excel formula or function. Sign up on our home page.
|
|
|
|
|
|
|
|
Exceljet
P.O. Box 4804
Salt Lake City, UT 84110
Copyright © 2025 Exceljet, All rights reserved.
You received this email because you are subscribed to our newsletter.
To unsubscribe, click the link below.
|
|
|
|
|