SUBSTITUTE

Syntax:

SUBSTITUTE ( string , old-string , new-string [ , occurence ] )

Description: Produces a new string that is string with one or all occurrences of old-string replaced by new-string.

Arguments:

Name

Type

Description

string

text

Designates a string.

old-string

text

Designates a string.

new string

text

Designates a string.

occurence

number

The occurrence number of the old-string characters within string-1 that is to be replaced by the string designated by new-string. If omitted, all occurrences of old-string characters shall be replaced.

Return Type and Value: text – A string that is string with one or all occurrences of old-string replaced by new-string.

However, if occurance < 0, #VALUE! is returned.

example: