✖️ Cross join two lists in Google Sheets
Today I learned how to do a "CROSS JOIN" or "cartesian product" between two columns in Google Sheets thanks to this stackoverflow question.
The answer: =INDEX(FLATTEN(A1:A3&"-"&TRANSPOSE(B1:B2)))
A | B | C |
---|---|---|
a | 1 | a-1 |
b | 2 | a-2 |
c | b-1 | |
b-2 | ||
c-1 | ||
c-1 |
From there, it's just a simple text to columns and depending on the data, maybe removing some duplicates.