Bird
Raised Fist0
Google Sheetsspreadsheet~15 mins

SUBSTITUTE and REPLACE in Google Sheets - Real Business Scenario

Choose your learning style10 modes available
Scenario Mode
👤 Your Role: You are a customer service analyst at an online retail company.
📋 Request: Your manager wants you to clean and update the customer feedback data by fixing typos and replacing outdated product codes.
📊 Data: You have a list of customer comments with some misspelled words and product codes that need updating.
🎯 Deliverable: A cleaned-up column of feedback with corrected words and updated product codes using SUBSTITUTE and REPLACE formulas.
Progress0 / 5 steps
Sample Data
Customer IDFeedback
101Love the prodcut ABC123, very useful!
102Product ABC123 is great but delivery was slow.
103Received prodcut XYZ789, but it was damaged.
104prodcut ABC123 needs better packaging.
105Happy with product XYZ789, fast shipping!
1
Step 1: Use SUBSTITUTE to fix the misspelled word 'prodcut' to 'product' in the Feedback column.
=SUBSTITUTE(B2, "prodcut", "product")
Expected Result
Love the product ABC123, very useful!
2
Step 2: Apply the SUBSTITUTE formula to all rows in a new column to correct all misspellings.
Copy the formula =SUBSTITUTE(B2, "prodcut", "product") down from row 2 to row 6.
Expected Result
All 'prodcut' words corrected to 'product' in the new column.
3
Step 3: Use REPLACE to update the old product code 'ABC123' to 'DEF456' in the corrected feedback text.
=REPLACE(C2, FIND("ABC123", C2), 6, "DEF456")
Expected Result
Love the product DEF456, very useful!
4
Step 4: Apply the REPLACE formula to all rows where 'ABC123' appears to update the product code.
Copy the formula =IF(ISNUMBER(FIND("ABC123", C2)), REPLACE(C2, FIND("ABC123", C2), 6, "DEF456"), C2) down the column.
Expected Result
All 'ABC123' codes replaced with 'DEF456' in the new column; other rows remain unchanged.
5
Step 5: Combine SUBSTITUTE and REPLACE in one formula to clean feedback and update product codes in one step.
=IF(ISNUMBER(FIND("ABC123", SUBSTITUTE(B2, "prodcut", "product"))), REPLACE(SUBSTITUTE(B2, "prodcut", "product"), FIND("ABC123", SUBSTITUTE(B2, "prodcut", "product")), 6, "DEF456"), SUBSTITUTE(B2, "prodcut", "product"))
Expected Result
Cleaned feedback with 'prodcut' fixed and 'ABC123' replaced by 'DEF456' in one formula.
Final Result
Customer ID | Cleaned Feedback
---------------------------------------------
101         | Love the product DEF456, very useful!
102         | Product DEF456 is great but delivery was slow.
103         | Received product XYZ789, but it was damaged.
104         | product DEF456 needs better packaging.
105         | Happy with product XYZ789, fast shipping!
✓All misspelled words 'prodcut' were corrected to 'product'.
✓Old product code 'ABC123' was updated to 'DEF456' wherever it appeared.
✓Feedback text is now clean and consistent for better analysis.
Bonus Challenge

Create a formula that also replaces 'XYZ789' with 'LMN321' in the cleaned feedback, combining all replacements in one formula.

Show Hint
Use nested SUBSTITUTE functions to replace multiple different text strings in one formula.

Practice

(1/5)
1. What does the SUBSTITUTE function do in Google Sheets?
easy
A. It formats cells with colors.
B. It changes text based on position and length.
C. It adds numbers together.
D. It replaces specific text by matching exact words or letters.

Solution

  1. Step 1: Understand SUBSTITUTE purpose

    The SUBSTITUTE function looks for specific text and replaces it exactly where it matches.
  2. Step 2: Compare with REPLACE

    Unlike REPLACE, SUBSTITUTE does not use position but matches text content.
  3. Final Answer:

    It replaces specific text by matching exact words or letters. -> Option D
  4. Quick Check:

    SUBSTITUTE = Replace by matching text [OK]
Hint: SUBSTITUTE changes text by matching words, not positions [OK]
Common Mistakes:
  • Confusing SUBSTITUTE with REPLACE
  • Thinking SUBSTITUTE works by position
  • Assuming SUBSTITUTE changes numbers
2. Which of these is the correct syntax for the REPLACE function in Google Sheets?
easy
A. REPLACE(text, start_num, num_chars, new_text)
B. REPLACE(text, old_text, new_text)
C. REPLACE(old_text, new_text, instance_num)
D. REPLACE(text, new_text, start_num)

Solution

  1. Step 1: Recall REPLACE syntax

    REPLACE requires the original text, the start position, number of characters to replace, and the new text.
  2. Step 2: Check options

    Only REPLACE(text, start_num, num_chars, new_text) matches this order and parameters correctly.
  3. Final Answer:

    REPLACE(text, start_num, num_chars, new_text) -> Option A
  4. Quick Check:

    REPLACE syntax = text, start, length, new text [OK]
Hint: REPLACE needs position and length, SUBSTITUTE needs old text [OK]
Common Mistakes:
  • Mixing parameter order
  • Using old_text instead of start_num
  • Omitting number of characters to replace
3. Given cell A1 contains the text "apple banana apple", what is the result of =SUBSTITUTE(A1, "apple", "orange", 2)?
medium
A. "orange banana orange"
B. "orange banana apple"
C. "apple banana orange"
D. "apple banana apple"

Solution

  1. Step 1: Understand SUBSTITUTE with instance number

    The formula replaces only the 2nd occurrence of "apple" with "orange".
  2. Step 2: Apply replacement

    First "apple" stays, second "apple" changes to "orange" resulting in "apple banana orange".
  3. Final Answer:

    "apple banana orange" -> Option C
  4. Quick Check:

    SUBSTITUTE replaces 2nd 'apple' only [OK]
Hint: Use 4th SUBSTITUTE argument to replace specific occurrence [OK]
Common Mistakes:
  • Replacing all occurrences instead of one
  • Replacing first occurrence by mistake
  • Confusing SUBSTITUTE with REPLACE
4. You want to replace the first 3 letters of the text in cell B2 with "XYZ". Which formula fixes the error in this incorrect formula: =SUBSTITUTE(B2, 1, 3, "XYZ")?
medium
A. =REPLACE(B2, "1", "3", "XYZ")
B. =REPLACE(B2, 1, 3, "XYZ")
C. =SUBSTITUTE(B2, "1", "XYZ", 3)
D. =SUBSTITUTE(B2, 3, 1, "XYZ")

Solution

  1. Step 1: Identify misuse of SUBSTITUTE

    SUBSTITUTE does not use position or length, so it cannot replace by position.
  2. Step 2: Use REPLACE for position-based replacement

    REPLACE takes start position, length, and new text, so =REPLACE(B2, 1, 3, "XYZ") is correct.
  3. Final Answer:

    =REPLACE(B2, 1, 3, "XYZ") -> Option B
  4. Quick Check:

    Use REPLACE for position-based text changes [OK]
Hint: Use REPLACE to change text by position, not SUBSTITUTE [OK]
Common Mistakes:
  • Using SUBSTITUTE with numbers as positions
  • Swapping parameters order
  • Using quotes incorrectly around numbers
5. You have a list of product codes in column A like "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?
hard
A. =SUBSTITUTE(REPLACE(A1, 1, 2, "X5"), "5", "9")
B. =REPLACE(SUBSTITUTE(A1, "5", "9"), 1, 2, "X5")
C. =SUBSTITUTE(A1, LEFT(A1, 2), "X5")
D. =REPLACE(A1, 1, 2, "X5") & SUBSTITUTE(A1, "5", "9")

Solution

  1. Step 1: Replace first two letters with REPLACE

    REPLACE(A1, 1, 2, "X5") changes first two letters to "X5".
  2. Step 2: Replace all "5" with "9" using SUBSTITUTE

    SUBSTITUTE(..., "5", "9") changes all 5's to 9's in the updated text.
  3. Step 3: Combine functions correctly

    Applying REPLACE first, then SUBSTITUTE on result is correct, matching =SUBSTITUTE(REPLACE(A1, 1, 2, "X5"), "5", "9").
  4. Final Answer:

    =SUBSTITUTE(REPLACE(A1, 1, 2, "X5"), "5", "9") -> Option A
  5. Quick Check:

    Chain REPLACE then SUBSTITUTE for combined changes [OK]
Hint: Nest REPLACE inside SUBSTITUTE to combine position and text changes [OK]
Common Mistakes:
  • Applying SUBSTITUTE before REPLACE causing wrong results
  • Concatenating results instead of nesting
  • Using SUBSTITUTE to replace by position
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard