Not sure how to even approach this. How do I complete the following which has come from a form:
ColA (UniqID) ColB
41447.9162847222 Name1, Name2, Name3, Name4
41447.9158912037 Name2, Name6, Name9
I would like to end up with:
ColA B
41447.9162847222 Name1
41447.9162847222 Name2
41447.9162847222 Name3
41447.9162847222 Name4
41447.9158912037 Name2
41447.9158912037 Name6
41447.9158912037 Name9
I can't use VLOOKUP or MATCH as Names may be duplicated in other records but ColA code will always be unique.
T
An answer using native spreadsheet functions:
=ArrayFormula(TRANSPOSE(REGEXREPLACE(SPLIT(CONCATENATE(SUBSTITUTE(", "&B:B;", ";CHAR(10)&A:A&CHAR(9)));CHAR(10));"(.*?)\t(.*)";{"$1";"$2"})))
Disadvantage is that all columns are coerced to text strings with this method. There are workarounds for this, but the formula would get even more ridiculous.
An answer using a Google Apps Script custom function, which also trims leading and trailing spaces in the comma-separated list, as per the request in comments:
and then invoke in a spreadsheet cell:
=advancedSplit(A:A;B:B)
My anecdotal observation is that for very large data sets, the latter method (custom function) has better performance than the former.