Challenge - 5 Problems
SUBSTITUTE and REPLACE Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📊 Formula Result
intermediate2:00remaining
What is the output of this SUBSTITUTE formula?
Given cell A1 contains the text
"apple banana apple", what will be the result of the formula =SUBSTITUTE(A1, "apple", "orange", 2)?Google Sheets
=SUBSTITUTE(A1, "apple", "orange", 2)
Attempts:
2 left
💡 Hint
The number 2 means only the second occurrence of "apple" is replaced.
✗ Incorrect
SUBSTITUTE replaces only the specified occurrence when the fourth argument is given. Here, only the second "apple" is replaced with "orange".
📊 Formula Result
intermediate2:00remaining
What does this REPLACE formula return?
If cell B1 contains
"1234567890", what is the result of =REPLACE(B1, 4, 3, "ABC")?Google Sheets
=REPLACE(B1, 4, 3, "ABC")
Attempts:
2 left
💡 Hint
REPLACE starts at position 4 and replaces 3 characters with "ABC".
✗ Incorrect
Starting at the 4th character, it removes 3 characters (4,5,6) and inserts "ABC" instead.
❓ Function Choice
advanced2:00remaining
Which formula replaces only the first occurrence of "cat" with "dog" in cell C1?
Cell C1 contains the text
"cat cat cat". Which formula will change only the first "cat" to "dog"?Attempts:
2 left
💡 Hint
SUBSTITUTE with the 4th argument controls which occurrence to replace.
✗ Incorrect
SUBSTITUTE with occurrence 1 replaces only the first "cat". REPLACE needs position and length but option A replaces only the first occurrence too, but option A is clearer and safer.
🎯 Scenario
advanced2:00remaining
You want to replace the 3rd word in a sentence with "blue". Which formula is best?
Cell D1 contains
"red green yellow black white". You want to replace the 3rd word "yellow" with "blue" using a formula. Which approach works best?Attempts:
2 left
💡 Hint
REPLACE needs the exact position and length of the text to replace.
✗ Incorrect
Option B finds the position of "yellow" and replaces exactly that word with "blue". SUBSTITUTE with occurrence 3 won't work because "yellow" appears only once.
❓ data_analysis
expert2:00remaining
How many replacements occur with this formula?
Cell E1 contains
"one two one two one two". What is the number of replacements made by =SUBSTITUTE(E1, "one", "three")?Google Sheets
=SUBSTITUTE(E1, "one", "three")
Attempts:
2 left
💡 Hint
Without the 4th argument, SUBSTITUTE replaces all occurrences.
✗ Incorrect
SUBSTITUTE replaces all occurrences of "one" with "three". There are 3 "one" words, so 3 replacements happen.