To simply combine them you can place them all together like this:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"_AB","_"),"_CD","_"),"_EF","_"),"_40K",""),"_60K",""),"_S_","_"),"_","-")

(note that this may pass the older Excel limit of 7 nested statements. I'm testing in Excel 2010


Another way to do it is by utilizing Left and Right functions.

This assumes that the changing data on the end is always present and is 8 characters long

=SUBSTITUTE(LEFT(A2,LEN(A2)-8),"_","-")

This will achieve the same resulting string


If the string doesn't always end with 8 characters that you want to strip off you can search for the "_S" and get the current location. Try this:

=SUBSTITUTE(LEFT(A2,FIND("_S",A2,1)),"_","-")
Answer from Automate This on Stack Overflow
🌐
Microsoft Fabric Community
community.fabric.microsoft.com › t5 › Desktop › substitute-multiple-values › m-p › 50217
Solved: substitute multiple values - Microsoft Fabric Community
July 20, 2016 - Solved: Hi I would like to substistute multiple values with one value, In Excel it can be done by =Substitute(Cell reference, {
Discussions

Using substitute to remove multiple characters at the same time
Assuming you are using Excel online or Excel 365 =REDUCE(A2,D2:D6,LAMBDA(x,y, SUBSTITUTE(x,y, ""))) Where A2 is your input cell and D2:D6 is a range holding all the characters you wish to remove. More on reddit.com
🌐 r/excel
24
6
June 28, 2024
Substitute Multiple Characters
In column A and B i have a set of character matches. Like this: & n ( _ ^ _ $ D # N The above is a fixed source. Next I have a dynamic list of values with multiple and random occurrences of the characters in Column A. I want a formula that will replace each of the characters in... More on mrexcel.com
🌐 mrexcel.com
18
0
June 30, 2009
Replace multiple specific pieces of text in a cell
Hi everyone, I'd like to be able to find and replace multiple strings of text in a single cell using one formula. e.g. cell A1 = "Daytime 20.50, Evening and Weekend 11.75" cell A2 old text = 20.50 cell A3 old text = 11.75 cell B2 new text = 22.50 cell B3 new text = 12.50 What formula can I... More on mrexcel.com
🌐 mrexcel.com
3
0
November 19, 2024
excel - Can you use SUBSTITUTE for many values without nesting? - Stack Overflow
Is there a way to swap many instances of strings at once without nesting? For instance, say I want to drop all instances of the following values from a string: Target Walmart CVS Input String: &qu... More on stackoverflow.com
🌐 stackoverflow.com
🌐
ExcelDemy
exceldemy.com › home › excel formulas › how to substitute multiple characters in excel: 7 methods
How to Substitute Multiple Characters in Excel: 7 Methods - ExcelDemy
June 16, 2024 - To run a VBA code to substitute multiple characters, just follow the steps described below. ... Press Alt + F11 to open the Macro-Enabled Worksheet. Go to the Insert tab. Select Module. ... Sub replaceAll() 'declare object variable to hold reference to cell you work with Dim myCell As Range 'declare variables to hold parameters for string replacement (string to replace and replacement string) Dim myStringToReplace As String Dim myReplacementString As String 'identify cell you work with Set myCell = ThisWorkbook.Worksheets("VBA").Range("C5") 'specify parameters for string replacement (string to replace and replacement string) myStringToReplace = "234-235-5689" myReplacementString = "234 235 5689" 'replace all occurrences within string in cell you work with, and assign resulting string to Range.
🌐
Ablebits
ablebits.com › ablebits blog › excel › find & replace › excel: find and replace multiple values at once
Excel: find and replace multiple values at once
June 26, 2026 - Several ways to find and replace multiple words, strings and characters in Excel using formulas, macros or special tool.
🌐
Exceljet
exceljet.net › home › formulas › find and replace multiple values
Find and replace multiple values - Excel formula | Exceljet
October 29, 2025 - To find and replace multiple values (i.e., perform a batch replace all operation), you can use the REDUCE function with a custom LAMBDA function to perform multiple substitutions in a single operation.
🌐
Automate Excel
automateexcel.com › home › substitute multiple values – excel & google sheets
Substitute Multiple Values - Excel & Google Sheets - Automate Excel
February 8, 2023 - This tutorial will demonstrate how to find and replace multiple values using nested SUBSTITUTE functions. To find and replace multiple values in Excel, use the SUBSTITUTE function within a nested formula:
Find elsewhere
🌐
MrExcel
mrexcel.com › forums › question forums › excel questions
Substitute Multiple Characters | MrExcel Message Board
June 30, 2009 - Just in case it may be useful to someone else: Function ArraySubstitute(OrigStr As String, rng1 As Range, rng2 As Range) If rng1.Columns.Count > 1 Then ArraySubstitute = "Error": Exit Function If rng2.Columns.Count > 1 Then ArraySubstitute = "Error": Exit Function If rng1.Rows.Count <> rng2.Rows.Count Then ArraySubstitute = "Error": Exit Function ArraySubstitute = OrigStr Dim ch As String For a = 1 To Len(OrigStr) 'Looping through each character in the string ch = Mid(OrigStr, a, 1) For b = 1 To rng1.Rows.Count If rng1.Cells(b, 1) = ch Then ch = rng2.Cells(b, 1) If a = 1 Then ArraySubstitute =
🌐
Statology
statology.org › home › excel: how to substitute multiple values in cell
Excel: How to Substitute Multiple Values in Cell
June 2, 2023 - This tutorial explains how to substitute multiple values in a cell in Excel at once, including an example.
🌐
Liangshunet
liangshunet.com › en › 201910 › 381375516.htm
Excel substitute function usage(8 examples, with multiple characters,nest,vba,quantity in formula)-Lionsure
November 25, 2019 - If you want to replace one word with another or replace a long string of characters with empty text(""), use two functions to achieve the following: 1. If you want to replace "Excel" with "Word" in A1. Double-click the cell B1, copy the formula =REPLACE(A1,1,4,"Excel") to B1, press Enter, return to "Excel table technique"; double-click B2, and copy the formula =SUBSTITUTE(A1,"Word","Excel") to B2, press Enter, and return also to "Excel table technique".
🌐
MrExcel
mrexcel.com › forums › question forums › excel questions
Replace multiple specific pieces of text in a cell | MrExcel Message Board
November 19, 2024 - Hi everyone, I'd like to be able to find and replace multiple strings of text in a single cell using one formula. e.g. cell A1 = "Daytime 20.50, Evening and Weekend 11.75" cell A2 old text = 20.50 cell A3 old text = 11.75 cell B2 new text = 22.50 cell B3 new text = 12.50 What formula can I write to achieve the following outcome in cell B1? = "Daytime 22.50, Evening and Weekend 12.50" Click to expand... Don't worry guys I've worked it out! I used =SUBSTITUTE(SUBSTITUTE(A1,A2,B2),A3,B3)
🌐
Microsoft Support
support.microsoft.com › en-us › excel › functions › substitute-function
SUBSTITUTE function - Excel 2021
This article describes the formula syntax and usage of the SUBSTITUTE function in Microsoft Excel. Substitutes new_text for old_text in a text string.
Top answer
1 of 3
7

Update 27-4-'22:

Since LAMBDA() and it's helper functions have now been released to the production versions of ms365, one could use REDUCE():

=TRIM(REDUCE(A1,{"Target","Walmart","CVS"},LAMBDA(a,b,SUBSTITUTE(a,b,""))))

Or, even try:

=TEXTJOIN(" ",,TEXTSPLIT(A1,{" ","Target","Walmart","CVS"}))

But, be aware of possible false positives, however SUBSTITUTE() and TEXTSPLIT() are both case-sensitive so for these proper words it seemed to work out fine. To counter false positives, 1st change spaces to tripple spaces for example and go from there (or use the old answer which is still valid). Another option is to nest FILTER():

=TEXTJOIN(" ",,REDUCE(TEXTSPLIT(A1," ",,1),{"Target","Walmart","CVS"},LAMBDA(a,b,FILTER(a,a<>b))))

Old Answer (Still valid since it avoids false positives):

I guess I'd go with a "Yes it's possible, but..." answer. It may be a stretch but I noticed you haven't used any punctuation which lead me to believe we can split a string on the space and filter out the unwanted parts that way, piecing back together the wanted parts:

Formula in A2:

=TEXTJOIN(" ",,FILTERXML("<t><s>"&SUBSTITUTE(A1," ","</s><s>")&"</s></t>","//s["&TEXTJOIN(" and ",,".!= '"&B1:B3&"'")&"]"))

Now you can add as many values to your range of unwanted strings without further adaptation to your formula.

  • Note that this does require Excel 2019 or later for the TEXTJOIN() to work. With Excel 2019 you'd also need to confirm through CtrlShiftEnter.
  • Also note that this will need some adaptation the minute you start using punctuation.
  • A last remark is that FILTERXML() is case-sensitive.
2 of 3
6

There is no way with SUBSTITUTE outside of nesting to do what is wanted. In the future LAMBDA will be an option.

For now and for backwards compatibility, here is a UDF that creates a function that takes many inputs and replaces them with the desired output.

It uses a param array so one can also create individual replacements:

Function SUBALL(str As String, ParamArray arr() As Variant) As String
    Dim i As Long
    For i = LBound(arr) To UBound(arr) Step 2
        Dim rngarr As Variant
        rngarr = arr(i)
        
        If UBound(arr) > i Then
            Dim rpArr As Variant
            rpArr = arr(i + 1)
        Else
            Dim df As Boolean
            df = True
        End If
        
        If TypeName(rngarr) = "String" Then
            If df Then
                str = Replace(str, rngarr, "")
            Else
                str = Replace(str, rngarr, rpArr)
            End If
        Else
            Dim j As Long
            For j = LBound(rngarr, 1) To UBound(rngarr, 1)
                If df Then
                    str = Replace(str, rngarr(j, 1), "")
                Else
                    str = Replace(str, rngarr(j, 1), rpArr(j, 1))
                End If
            Next j
        End If
    Next i
    
    SUBALL = str
End Function

It defaults to a replace of ""

So in this instance:

=SUBALL(A1,H1:H3)

But we can also do where we specify the output:

=SUBALL(A1,H1:H3,I1:I3)

Or we can put the options as strings in the formula itself with their desired replacements:

=SUBALL(A1,"Target","MyVal","Walmart","","CVS","Long Receipt Place")


As with all UDF, there are some rules that must be followed. The pairs must have the same number of arguments. You CANNOT do:

=SUBALL(A1,H1:H3,"Word")

It will fail. But:

=SUBALL(A1,H1:H3,{"Word";"Word";"Word"})

Will work.


With SCAN and LAMBDA:

=LET(rpl,H1:H3,str,A1,INDEX(SCAN(str,rpl,LAMBDA(a,b,SUBSTITUTE(a,b,""))),COUNTA(rpl)))

If we want to replace words with other words we can use:

=LET(orig,H1:H3,rpl,I1:I3,str,A1,cnt,COUNTA(rpl),INDEX(SCAN(str,SEQUENCE(cnt),LAMBDA(a,b,SUBSTITUTE(a,INDEX(orig,b),INDEX(rpl,b)))),COUNTA(rpl)))

🌐
MrExcel
mrexcel.com › forums › question forums › excel questions
substitute() multiple text | MrExcel Message Board
February 17, 2021 - That's not strictly true, although with the complexity of the array method it would need more than just 2 or 3 different words to substitute in order to justify using it. The formula in column B is best guess for older versions I think it may also need to use T(IF({1},.. for some additional coercion but don't have a suitable version of excel installed for testing it.
🌐
How To Excel
howtoexcel.org › how-to-find-and-replace-multiple-text-strings-within-a-text-string
How To Find And Replace Multiple Text Strings Within A Text String | How To Excel
In this post we’re going to explore how to find and replace multiple text strings from within another string. ... Excel has a great built in function called SUBSTITUTE which allows you to find one bit of text within another text string and substitute it for another bit of text.
🌐
Get-digital-help
get-digital-help.com › substitute-multiple-text-strings-vba
Substitute multiple text strings
March 6, 2023 - How to extract numbers from a cell value Working with numbers in Excel can be deceptively tricky, especially when they're embedded within text or need to be formatted […] More than 1300 Excel formulas ... Function SubstituteMultiple(text As String, old_text As Range, new_text As Range) Dim i As Single For i = 1 To old_text.Cells.Count Result = Replace(text, old_text.Cells(i), new_text.Cells(i)) text = Result Next i SubstituteMultiple = Result End Function
🌐
ExtendOffice
extendoffice.com › excel tips › excel formulas › find and replace multiple values in excel
Find and replace multiple values in Excel
October 22, 2024 - For example, to replace all “Excel” ... solving this task in Excel. To deal with this job, you should nest multiple SUBSTITUTE functions together, and insert the find and replace pairs using the INDEX function....
🌐
Excel Tip
exceltip.com › home › excel tips and tricks
How to Find and Replace Multiple Values in Excel
June 3, 2021 - To find and replace a given text we use the SUBSTITUTE function. Where REPLACE is used to replace a number of characters in string… · Replace text from end of a string starting from variable position: To replace text from the end of the string, ...
🌐
Excel Champs
excelchamps.com › excel champs › excel formulas list › how to substitute multiple values (nested) in excel
How to Substitute Multiple Values (Nested) in Excel (Formula)
March 13, 2023 - To replace more than one value in a cell, nest SUBSTITUTE inside itself — each function works on the result of the one before it: =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"One","1"),"Two","2"),"Three","3"). Build it from the inside out, so the ...