Introduction
Hello, Stack Overflow. I'm hoping to get your expertise on an issue that I find myself occasionally running into in Microsoft Excel. Please see the context and information that I have presented along with my question below.
Please let me know if I can clarify what I'm looking for and/or if I can supply any additional details.
Thanks as always! This community is always such a great asset.
Background/Context
Converting Tables to Contain Values Stored on Another Table
I often find myself needing to convert an original table's values (let's call them 'A' Values) to a corresponding value stored on another table ('B' Values).
Depending on the complexity entailed, I can typically just use plain 'Find/Replace' or 'VLOOKUP' or some combination of the two, so long as each cell contains only one value.
Files Containing Multiple Values within Single Cells
Lately, I find myself needing to convert multiple 'A' values (separated by semicolons) stored together within single cells. Note: In 'real world' scenarios, there are usually about 200-300 rows and about 80 unique 'A' values, so making manual updates isn't very practical. I've made an attempt at a generic illustration below.
Illustration
For the sake of illustration, let's assume that each of the individual values in Table 1 must be converted to the values in accordance with the crosswalk stored in Table 2.
Table 1: Original 'A' Values
| 'A' Values |
|---|
| A123; A456; A789 |
| A789; A098; A123 |
| A456 |
| A123; A456 |
| A456 |
| And So On, For about 300 Rows, with Around 80 Unique Values |
Table 2: Crosswalk: 'A' Values to 'B' Values
| 'A' Value | 'B' Value |
|---|---|
| A123 | B123 |
| A456 | B456 |
| A789 | B789 |
| And So On... | And So On... |
Table 3: Ideal End Result (A Values Converted to B Values)
| B Values |
|---|
| B123; B456; B789 |
| B789; B098; B123 |
| B456 |
| And So On... |
Analysis
Given that the 'A' Values are stored together in Table 1, methods such as Excel's Find/Replace or VLOOKUP are not immediately available to pull in the corresponding 'B' Values.
I have a workaround whereby I use Excel's 'Text to Columns' to divide Table 1's rows into single cells, and then use a VLOOKUP to pull in the 'B' Value, and then use a Concatenate function to stitch the rows back together again, but it's a hassle, and prone to Human error.
I've been looking all over the place for answers on this topic, and I have yet to have any luck in finding someone working on the same issue.
Question
Might I be able to somehow automate all or part of this burdensome process with something like VBA to automatically replace all of Table 1's 'A' values with their corresponding 'B' values? I'm open to any/all potential solutions. Right now, I'm not even sure to how to get started, or whether my issue is even solvable to begin with.
Thanks again!