Complete the formula to replace all occurrences of "apple" with "orange" in cell A1.
=SUBSTITUTE(A1, [1], "orange")
The SUBSTITUTE function replaces all occurrences of the text you specify. Here, we want to replace "apple" with "orange".
Complete the formula to replace only the first occurrence of "cat" with "dog" in cell B2.
=SUBSTITUTE(B2, "cat", [1], 1)
The third argument is the replacement text. Here, we replace the first "cat" with "dog".
Fix the error in the formula to replace "blue" with "red" in cell C3.
=SUBSTITUTE(C3, [1], "red")
The text to find must be in quotes. Without quotes, it is treated as a cell or name, causing an error.
Fill both blanks to replace only the second occurrence of "cat" with "dog" in cell D4.
=SUBSTITUTE(D4, [1], [2], 2)
The first blank is the text to find, "cat". The second blank is the replacement text, "dog". The last argument 2 means only the second occurrence is replaced.
Fill all three blanks to replace "red" with "green" in cell E5, but only for the third occurrence.
=SUBSTITUTE(E5, [1], [2], [3])
The first blank is the text to find "red". The second blank is the replacement text "green". The third blank is the occurrence number 3, meaning only the third "red" is replaced.