SUBSTITUTE

Description

Replaces a specified part of a text string with another text string.

Syntax

SUBSTITUTE ( text, "old_text", "new_text" [, instance] )

Parameter Description
text A text string that contains the text to replace.
old_text The text string to be replaced.
new_text The replacement text.
instance Specifies the occurrence of old_text to replace. If this argument is omitted, every instance of old_text is replaced.

Examples

This function returns "Second Quarter Results":

SUBSTITUTE("First Quarter Results", "First", "Second")

This function returns "Shipment 45, Bin 52":

SUBSTITUTE("Shipment 45, Bin 45", "45", "52", 2)

See also

REPLACE

TRIM