PrecisionCalc
inspector
text
Do Anything with Text in Formulas
itSUBSTITUTER
Same as Excel's built-in SUBSTITUTE function, but searches from right to left.
Substitutes text in a text string, searching for the text to replace from right to left.
itSUBSTITUTER is intended to be as similar as possible to Excel's built-in SUBSTITUTE function, while searching from right to left. For much more powerful and versatile text substitution, see itREPLACE.
Syntax
itSUBSTITUTER(text, old_text, new_text, instance_num)
text | Required. The text containing the text to be substuted. |
old_text | Required. The text to be replaced. |
new_text | The text to replace old_text |
instance_num | Which occurrence of old_text
to replace with new_text, counting from the right. If omitted, all occurrences of old_text are replaced with new_text. If instance_num is omitted, itSUBSTITUTER works exactly like Excel's built-in SUBSTITUTE function. |
Examples
Formula | Description | Result |
=itSUBSTITUTER("abababab","a","A") | Replace all occurrences of "a" in "abababab" with "A". | AbAbAbAb |
=itSUBSTITUTER("abababab","a","A",2) | Replace the 2nd occurrence (counting from the right) of "a" in "abababab" with "A". | ababAbab |