Search code examples
google-sheetsjoinsplitflattentextjoin

Google Sheets Formula For Separating Items in a List


I'm looking for help in writing a Google Sheets formula in Cell C1 with an input of this range in A1:B1 :

A B
122, 123, 124 Apple, Orange, Pear

and get an output of this:

C D
122 Apple, Orange, Pear
123 Apple, Orange, Pear
124 Apple, Orange, Pear

Solution

  • use:

    =INDEX(SPLIT(FLATTEN(SPLIT(A1, ",")&"×"&B1), "×"))
    

    enter image description here