Text
Substitute multiple values at once: template placeholders and mixed delimiters
Replace Name and Plan placeholders sequentially, or normalize the example’s mixed separators.
Readable multi-token replacement with LET vs array delimiter normalization
1. Multi-Variable Templates: Deeply nested SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(...))) becomes unreadable past 2 swaps. Naming each intermediate step inside LET(nameReplaced, SUBSTITUTE(A2, "{{Name}}", B2), planReplaced, SUBSTITUTE(nameReplaced, "{{Plan}}", C2), ...) makes 3–6 token replacements self-documenting!
2. Mixed Delimiter Cleanup: When normalizing messy separators (";", "|", "/") into clean ", ", skip nested SUBSTITUTE altogether—TEXTJOIN(", ", TRUE, TEXTSPLIT(D2, {"; ",";"," | ","|"," / ","/"}, , TRUE)) splits on all delimiters and collapses empty gaps in one pass!
| Messy Input | Formula Pattern | Clean Standardized Output |
|---|---|---|
| "Hi {{Name}}, your {{Plan}} tier is active." | LET + chained SUBSTITUTE | "Hi Elena, your Pro tier is active." |
| "SQL; Python | Excel / R" | TEXTJOIN + multi-delim TEXTSPLIT | "SQL, Python, Excel, R" |
Multi-placeholder LET + SUBSTITUTE and delimiter-cleanup formulas
Each named variable inside LET performs exactly one token swap cleanly.
=LET(nameReplaced, SUBSTITUTE(A2, "{{Name}}", B2), planReplaced, SUBSTITUTE(nameReplaced, "{{Plan}}", C2), planReplaced)Normalize mixed semicolons, pipes, and slashes into ", "
The delimiter list handles the demonstrated spacing. Normalize token-level whitespace separately when input conventions differ.
=TRIM(TEXTJOIN(", ", TRUE, TEXTSPLIT(D2, {"; ",";"," | ","|"," / ","/",", ",","}, , TRUE)))Inputs and interpretation
SUBSTITUTE replacements are sequential and case-sensitive. A replacement value containing a later placeholder will itself be modified; exclude such values or use a proper template parser. Delimiter splitting is not CSV parsing and does not preserve quoted separators. Outer TRIM normalizes ordinary spaces, not all Unicode whitespace or each token independently.
Try the example
Use the original values or change them to test your understanding.