You can use the REPLACE function in conjunction with the SEARCH function to replace part of a text string with another string. In effect, you use the SEARCH function to find the starting location used by the REPLACE function.
For example, assume cell A1 contains the text Annual Profit Figures. The following formula searches for the word Profit and replaces those six characters it with the word Loss:
=REPLACE(A1,SEARCH("Profit",A1),6,"Loss")
This next formula uses the SUBSTITUTE function to accomplish the same effect in a more efficient manner:
=SUBSTITUTE(A1,"Profit","Loss")
Popularity: 6% [?]








Recent Comments