• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Substitute Formula

a_dani20

New Member
Hi guys


Can substitute formula be used to replace more than one text string?? if not how i can replace more than 1 text string in a sentence???
 
Substitute will change every occurrence of the Old_Txt in the search string, unless you give it a Instance_Num field. I'm going to guess that's not what you're asking.


Substitute doesn't work like CountIFS or SumIFS, where you can have multiple comparisons. Nothing stops you from nesting substitutes into a single cell:


=SUBSTITUTE(SUBSTITUTE(TestText,"old","new"),"fox","cat")


Excel evaluates this from the inside out, per normal. The "old"/"new" change happens first.


Depending on what type of text strings you're working with, nesting could give some unexpected results.
 
Back
Top