# SUBSTITUTE

#### Syntax <a href="#syntax.53" id="syntax.53"></a>

**SUBSTITUTE**(*text*; *oldText*; *newText; option*)

* *text* - the text in which to search for oldText - ***Value type**: text*
* *oldText* - the text which is to be found in parameter text - ***Value type**: text*
* *newText* - the text with which *oldText* should be replaced- ***Value type**: text*
* *option* - defines if the substitution should be done with a regular expression - ***Value type**: constant (optional, default: empty - i.e. plain text replacement)*

  Possible values are

  * *regex* - the replacement should be done using a regular expression for parameter *oldText*

#### Remarks <a href="#remarks.40" id="remarks.40"></a>

* The *text* parameter can also be a range with several texts. The SUBSTITUTE function is then applied to all these texts.
* For the parameters *oldText* and *newText*, column ranges can be specified. The text replacement then takes place one after the other (from top to bottom) for all text pairs of these two parameters.
* The search is performed case-sensitive, so the found text within parameter *text* must have the same casing than the parameter *oldText*.

#### Examples <a href="#examples.17" id="examples.17"></a>

<figure><img src="https://1085786630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWv5M2BoEVu0kDIV5EPs4%2Fuploads%2Fgit-blob-60e6df6724e4278e275f29c0087ee4d961d00888%2Fgrafik.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1085786630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWv5M2BoEVu0kDIV5EPs4%2Fuploads%2Fgit-blob-99150bf3f240f8bee97bf105bc298713418fb1ec%2Fgrafik.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1085786630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWv5M2BoEVu0kDIV5EPs4%2Fuploads%2Fgit-blob-9c6f91aa034a856aa4d589c407f5ad2a6813f075%2Fgrafik.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1085786630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWv5M2BoEVu0kDIV5EPs4%2Fuploads%2Fgit-blob-dcd29025e29f7fcd7cfeebfb0e3731e703ef33bf%2Fgrafik.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1085786630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWv5M2BoEVu0kDIV5EPs4%2Fuploads%2Fgit-blob-76f4a335701d9300b66789a324cc3a197da85531%2Fgrafik.png?alt=media" alt=""><figcaption></figcaption></figure>
