I have 2 columns, first name and surname. I want to split a cell that contains multiple values and then combine it with the cell on the right. I have no idea how to do this using a formula, please help.
Before:
First Name | Surname |
---|---|
John,Jane,Mary | Fish |
Albert,Steven,Alice | Smith |
Expected Result:
First Name | Surname |
---|---|
John | Fish |
Jane | Fish |
Mary | Fish |
Albert | Smith |
Steven | Smith |
Alice | Smith |
use:
=INDEX(QUERY(SPLIT(FLATTEN(IF(IFERROR(
SPLIT(A1:A, ","))="",,SPLIT(A1:A, ",")&""&B1:B)), ""),
"where Col2 is not null", ))