Related Topics: | ||
Description: Substitutes New_text for Old_text in a text string. Use SUBSTITUTE when you want to replace specific text in a text string; use REPLACE when you want to replace any text that occurs in a specific location in a text string.
Syntax: SUBSTITUTE(Text, Old_text, New_text, [Instance_num])
Text is the text or the reference to a cell containing text for which you want to substitute characters.
Old_text is the text you want to replace.
New_text is the text you want to replace Old_text with.
Instance_num specifies which occurrence of Old_text you want to replace with New_text. If you specify Instance_num, only that instance of Old_text is replaced. Otherwise, every occurrence of Old_text in text is changed to New_text.
Example:
SUBSTITUTE("Sales Data", "Sales", "Cost") = Cost Data [substitutes Cost for Sales]
SUBSTITUTE("Quarter 1, 2011", "1", "2", 3) =Quarter 1, 2012 [substitutes third instance of "1" with "2"]
© 1992-2013. ReliaSoft Corporation. ALL RIGHTS RESERVED.