Announcement

Collapse
No announcement yet.

Unconfigured Ad Widget

Collapse

Substitute function, twice in one formula

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Substitute function, twice in one formula

    Is it possible to use the substitute function twice within the same formula? I need to substitute two separate text strings in cell A1. I'm able to do one, but when I use the ampersand to put the second substitute function into the formula, it does only the second substitute and not the first.

    Thanks!
    Dan

  • #2
    Re: Substitute function, twice in one formula

    You can next the functions. For example:
    =SUBSTITUTE(SUBSTITUTE("abcde","a","z"),"b","2")
    Please do not U2U (private message) me directly for questions that should be posted to the forum; any such U2Us will be ignored.

    Comment


    • #3
      Re: Substitute function, twice in one formula

      Dan,

      I'm not sure exactly what you're trying to do, but you can have a Substitute function within another Substitute function.

      Assuming cell A1 contains "test me for changes", the formula

      =SUBSTITUTE(SUBSTITUTE(A1,"me","you"),"for","against")

      will firstly substitute "me" with "you" then "for" with "against" and produce the result 'test you against changes'.

      If you change the value you have previously changed in the first substitute it will appear as though only the second one is being actioned, e.g.

      =SUBSTITUTE(SUBSTITUTE(A1,"me","you"),"you","them")

      will produce ' test them for changes', but this is the result of making the first change, then amending the result of that.

      Regards,
      Batman.
      Regards,
      Batman.

      Comment

      Trending

      Collapse

      There are no results that meet this criteria.

      Working...
      X