I have a data set that includes numerical IDs. The ID column can, and often does, contain a list of IDs separated by commas. Like this:
ID |
|---|
5 |
71 |
53 |
7 |
10,16,34,35,37,40 |
60,61 |
The IDs themselves correspond to Names but the system the data is exported from does not have the Names. I would like to do a VLOOKUP of the IDs to return the names so that the final output looks like this:
ID | Name |
|---|
5 | Alligator |
71 | Bear |
53 | Cat |
7 | Dog |
10,16,34,35,37,40 | Elephant, Flamingo, Gorilla, Hippo, Iguana, Jaguar |
60,61 | Koala, Leopard |
I expect that I'll need to use CONTAINS nested in an IF statement to identify when the ID column contains a list, but after that point I don't really know where to begin to look up each ID and return a Name, then recompile into a list of names. I'm thinking of using REPLACE as well, but I don't know if that will let me move through a list until all IDs have been replaced with names.
Any ideas?