Generate possible combinations into separate columns in Google Sheets

Viewed 83

I found many solutions online, but they are generating combinations as combined text. I want to generate them into separate columns like on picture below.

Formula should be in C1, based on columns A and B. New rows in A and B will populate new rows (combinations) in C and D.

Manual example

1 Answers

Try in C1

=arrayformula(SPLIT(flatten(offset(A1,,,COUNTA(A:A))&"|"&transpose(offset(B1,,,COUNTA(B:B)))),"|"))

enter image description here

Related