What if you could fix hundreds of typos in seconds without touching each cell?
Why SUBSTITUTE and REPLACE in Google Sheets? - Purpose & Use Cases
Imagine you have a long list of product codes or customer names in your spreadsheet, and you need to fix a typo or update part of each entry manually.
You start opening each cell, deleting or changing text by hand, one by one.
This manual method is slow and boring.
It's easy to make mistakes, like missing some cells or changing the wrong part of the text.
And if you have hundreds or thousands of entries, it becomes a huge headache.
The SUBSTITUTE and REPLACE functions let you fix or change text automatically.
They find the exact part you want to change and update it for all your data at once.
This saves time, reduces errors, and keeps your data consistent.
Open each cell > Find text > Delete or type new text > Save=SUBSTITUTE(A2, "old", "new") or =REPLACE(A2, 1, 3, "new")
You can quickly clean up or update large sets of text data with just one formula.
Say you have a list of email addresses with a wrong domain like "@oldcompany.com" and you want to change them all to "@newcompany.com" without typing each one.
Manual text changes are slow and error-prone.
SUBSTITUTE and REPLACE automate text updates in cells.
They help keep your data clean and save you lots of time.
Practice
SUBSTITUTE function do in Google Sheets?Solution
Step 1: Understand SUBSTITUTE purpose
The SUBSTITUTE function looks for specific text and replaces it exactly where it matches.Step 2: Compare with REPLACE
Unlike REPLACE, SUBSTITUTE does not use position but matches text content.Final Answer:
It replaces specific text by matching exact words or letters. -> Option DQuick Check:
SUBSTITUTE = Replace by matching text [OK]
- Confusing SUBSTITUTE with REPLACE
- Thinking SUBSTITUTE works by position
- Assuming SUBSTITUTE changes numbers
Solution
Step 1: Recall REPLACE syntax
REPLACE requires the original text, the start position, number of characters to replace, and the new text.Step 2: Check options
Only REPLACE(text, start_num, num_chars, new_text) matches this order and parameters correctly.Final Answer:
REPLACE(text, start_num, num_chars, new_text) -> Option AQuick Check:
REPLACE syntax = text, start, length, new text [OK]
- Mixing parameter order
- Using old_text instead of start_num
- Omitting number of characters to replace
"apple banana apple", what is the result of =SUBSTITUTE(A1, "apple", "orange", 2)?Solution
Step 1: Understand SUBSTITUTE with instance number
The formula replaces only the 2nd occurrence of "apple" with "orange".Step 2: Apply replacement
First "apple" stays, second "apple" changes to "orange" resulting in "apple banana orange".Final Answer:
"apple banana orange" -> Option CQuick Check:
SUBSTITUTE replaces 2nd 'apple' only [OK]
- Replacing all occurrences instead of one
- Replacing first occurrence by mistake
- Confusing SUBSTITUTE with REPLACE
=SUBSTITUTE(B2, 1, 3, "XYZ")?Solution
Step 1: Identify misuse of SUBSTITUTE
SUBSTITUTE does not use position or length, so it cannot replace by position.Step 2: Use REPLACE for position-based replacement
REPLACE takes start position, length, and new text, so =REPLACE(B2, 1, 3, "XYZ") is correct.Final Answer:
=REPLACE(B2, 1, 3, "XYZ") -> Option BQuick Check:
Use REPLACE for position-based text changes [OK]
- Using SUBSTITUTE with numbers as positions
- Swapping parameters order
- Using quotes incorrectly around numbers
"AB12345". You want to replace the first two letters with "X5" and also replace all occurrences of "5" with "9" in the same formula. Which formula achieves this?Solution
Step 1: Replace first two letters with REPLACE
REPLACE(A1, 1, 2, "X5") changes first two letters to "X5".Step 2: Replace all "5" with "9" using SUBSTITUTE
SUBSTITUTE(..., "5", "9") changes all 5's to 9's in the updated text.Step 3: Combine functions correctly
Applying REPLACE first, then SUBSTITUTE on result is correct, matching =SUBSTITUTE(REPLACE(A1, 1, 2, "X5"), "5", "9").Final Answer:
=SUBSTITUTE(REPLACE(A1, 1, 2, "X5"), "5", "9") -> Option AQuick Check:
Chain REPLACE then SUBSTITUTE for combined changes [OK]
- Applying SUBSTITUTE before REPLACE causing wrong results
- Concatenating results instead of nesting
- Using SUBSTITUTE to replace by position
Ready to prove it?
Pass the test and this pattern moves unknown
