In an Excel worksheet:
Column A is all filled with random text values (e.g., words / sentences) that need to be updated.
And columns B and C contain strings that specify the changes
that need to be made to column A.
Column B is filled each cell with the old text and column C with the new text, each line corresponding to each other, this is, text in B1 need to be substituted by text C1, B2 to be changed for C2 text. In column B one of the things to substitute is a ".
There are no repeated values in column B. Cells may be repeated in column C, though. The substitutions must obey the order in which they were written. And column D is the result.
Each cell from column A needs to pass through this substitution from B1-C1, B2-C2, B3-C3, etc., until the end of the substitution commands in columns B-C. So, before giving the final result, the text from column A will change several times, and only will show result in column D after all changes.
Example:
Cell A1: Hello!
Cell A2: How are you "John"?
Cell A3: "Nice! thanks"
Cell B1: ! Cell C1: &
Cell B2: & Cell C2: .
Cell B3: " Cell C3: (empty)
Cell B4: ? Cell C4: #
Cell B5: Nice. thanks Cell C5: Fine, THANKS.
So Cell A1, which is Hello!, will be changed by B1-C1, so will be Hello&.
Then will change B2-C2 with changes made to the temporary result Hello& so will be Hello..
Then will change B3-C3 and then will do B4-C4 and then B5-C5, and nothing will happen because " doesn’t exist in Hello..
After this, result D1 is Hello..
Then it will do A2 changes B1-C1 (nothing to do), then applied to this will do B2-C2 (nothing to do), then B3-C3 which will result as How are you John? (i.e., the quote characters will be removed), then will do B4-C4 which will make How are you John#, and then B5-C5 which has nothing to be done in here.
So result D2 is How are you John#.
The same way, A3 value "Nice! thanks" will have change from B1-C1 at first, becoming "Nice& thanks", then B2-C2 becoming "Nice. thanks", then B3-C3 becoming Nice. thanks (again, the quotes will be removed), then nothing to do in B4-C4 and then B5-C5 will make it become at last Fine, THANKS in D3.
Results:
D1: Hello.
D2: How are you John#
D3: Fine, THANKS.
What would be the formula in column D for doing this multiple substitutions in a row obeying the line order written in columns B and C, allowing column B-C to have more than 300 lines? (I would like a purely formula based-solution, rather than VBA, if possible.)
