Sample Data
Column A has text strings. B1 and B2 have words for substitution. B3 and B4 have numbers and text for replacement.
| Cell | Value |
|---|---|
| A1 | apple banana apple |
| A2 | 1234567890 |
| B1 | apple |
| B2 | orange |
| B3 | 345 |
| B4 | XYZ |
Column A has text strings. B1 and B2 have words for substitution. B3 and B4 have numbers and text for replacement.
| Cell | Value |
|---|---|
| A1 | apple banana apple |
| A2 | 1234567890 |
| B1 | apple |
| B2 | orange |
| B3 | 345 |
| B4 | XYZ |
=SUBSTITUTE(A1, B1, B2) & " | " & REPLACE(A2, 4, 3, B4)A B 1 |apple banana apple|apple | 2 |1234567890 |orange| 3 | |345 | 4 | |XYZ |
C 1 |orange banana orange | 123XYZ7890|
apple with orange in a text string?XYZ using the REPLACE function?=SUBSTITUTE("banana", "a", "o", 2)?=REPLACE(A1, 2, 3, "XYZ") returns an error. Which is the most likely cause?"Invoice12345" in cell A1. Which formula will replace the numeric part with "67890" regardless of how many digits the number has?Pass the test and this pattern moves unknown