home.gif next.gif prev.gif



SUBSTITUTE

See also A-Z Spreadsheet Function List


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

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

text is a text string that contains the text to replace. You can also specify a reference to a cell that contains text.

old_text is the text string to be replaced.

new_text is the replacement text.

instance specifies the occurrence of old_text to replace. If this argument is omitted, every instance of old_text is replaced.

See Also REPLACE and TRIM functions

Examples SUBSTITUTE(“First Quarter Results”, “First”, “Second”) returns “Second Quarter Results”

         SUBSTITUTE(“Shipment 45, Bin 45”, “45”, “52”, 2) returns “Shipment 45, Bin 52”