SUBSTITUTE function

The Klipfolio SUBSTITUTE function replaces a set of characters with another set of characters in a text string.

While the SUBSTITUTE function is similar to the REPLACE function, the SUBSTITUTE function is used to replace part of a value.

The syntax for the SUBSTITUTE function is:

SUBSTITUTE( text , old text, new text , occurrence )

Parameters

text The character(s) to be manipulated. text vector
old text The character(s) that will be replaced. text vector
new text The character(s) that are to replace the character(s) in old text. text vector
occurrence

Optional: Indicates the instance that will be replaced.

If the parameter is omitted every occurrence is replaced with the character(s) in new text.

number vector

 

SUBSTITUTE examples

Let's look at some SUBSTITUTE function examples.

The following examples are based on text from an Excel spreadsheet:

 

A

1 01/25/2014

SUBSTITUTE ( A:A , "/" ,"-" )

-> [01-25-2014]

 

A

1 white/123/dog

SUBSTITUTE ( A1 , "/" ,"-" , 2 )

-> [white/123-dog]

Related links:


Text functions