I am trying to match a single value in a cell with content of a comma-separated list in a cell in multiple rows and get all matches returned in a comma-separated list.
The source data sheet format looks like:
| Function ID | Test ID |
|---|---|
| 769356 | DAB-CTRL-TI-861 |
| 768859 | DAB-CTRL-TI-164, DAB-CTRL-TI-196, DAB-CTRL-TI-83 |
| 769366 | DAB-CTRL-TI-861 |
| 768709 | DAB-CTRL-TI-861 |
and I want to get a sheet that has a unique row per "Test ID" containing each match as a comma-separated list for column "Function ID" that looks like:
| Test ID | Function ID |
|---|---|
| DAB-CTRL-TI-861 | 769356, 769366, 768709 |
| DAB-CTRL-TI-164 | 768859 |
| DAB-CTRL-TI-196 | 768859 |
| DAB-CTRL-TI-83 | 768859 |
In the second sheet column "Function ID" I have tried the following formula but it only matches the first occurrence and also makes false matches when the list contains substrings, e.g. matches DAB-CTRL-TI-8 when it should match DAB-CTRL-TI-88 so using a partial match for values in the list when it should make an exact match per list entry.
=VLOOKUP("*"&B2&"*",Sheet1!A:B,2,FALSE)



