Formula to Combine Multi-Select Values in Two Different Columns

Imagine I have the following two columns with the following values

Numbers (column 1):

  • First Row: 1, 2, 3

Letters (column 2)

  • First Row: a, b

Now I have Column 3. I want the values for column three to be determined by looping through the values of columns 1 and 2 and combining them as follows:

  • Row 1: 1a
  • Row 2: 1b
  • Row 3: 2a
  • Row 4: 2b
  • Row 5: 3a
  • Row 6: 3c

In short, I want to loop through each value in column one and then add it to each value in column two (by looping through it’s values).

Any idea how I could do this using coda formulas?

Thanks.

Hi @SM1
and welcome to Coda Community! :handshake:

Try the following Formula:

thisRow.[Column 1].Split(",")
.FormulaMap(CurrentValue.WithName(one, 
thisRow.[Column 2].Split(",")
.FormulaMap(CurrentValue.WithName(two, 
Format("{1}{2}",one,two)))))
.ListCombine().FormulaMap(CurrentValue).BulletedList()

I think it can be optimised: I’m not super happy of the last iteration, but first tell me if this is the desired output.

Thanks!

2 Likes