Complete the formula to replace all occurrences of "cat" with "dog" in cell A1.
=SUBSTITUTE(A1, [1], "dog")
The SUBSTITUTE function replaces all occurrences of the text you specify. Here, we want to replace "cat" with "dog".
Complete the formula to replace only the second occurrence of "apple" with "orange" in cell B2.
=SUBSTITUTE(B2, "apple", [1], 2)
The third argument in SUBSTITUTE is the replacement text. To replace the second occurrence, we specify 2 as the fourth argument.
Fix the error in this formula to replace 3 characters starting at position 5 in cell C3 with "XYZ".
=REPLACE(C3, 5, [1], "XYZ")
The REPLACE function replaces a number of characters starting at a position. Here, we want to replace 3 characters starting at position 5.
Fill both blanks to create a formula that replaces the first occurrence of "red" with "blue" in cell D4.
=SUBSTITUTE(D4, [1], [2], 1)
The SUBSTITUTE function replaces text. The second argument is the text to find, the third is the replacement, and the fourth is which occurrence to replace.
Fill all three blanks to create a formula that replaces 4 characters starting at position 3 in cell E5 with the text "done".
=REPLACE(E5, [1], [2], [3])
The REPLACE function needs the start position, number of characters to replace, and the new text. Here, start at 3, replace 4 characters, with "done".