Reputation: 103
I have a Google Spreadsheets with three columns.
I need to populate the Column C with all the possible combinations of the values in Columns A and B. Please take a look a the capture to see what I mean.
I found this following formula, but it output result not same.but i need same as image.
i am using this code:
=ArrayFormula(transpose(split(rept(concatenate(A2:A&char(9)),counta(B2:B)),char(9)))
&" "&transpose(split(concatenate(rept(B2:B&char(9),counta(A2:A))),char(9))))
Upvotes: 2
Views: 2202
Reputation: 201378
transpose(split(rept(concatenate(A2:A&char(9)),counta(B2:B)),char(9)))
and transpose(split(concatenate(rept(B2:B&char(9),counta(A2:A))),char(9)))
.A
and B
.=ArrayFormula(transpose(split(concatenate(rept(A2:A&char(9),counta(B2:B))),char(9)))&" "&transpose(split(rept(concatenate(B2:B&char(9)),counta(A2:A)),char(9))))
In this sample, above formula is put to the cell C2
.
Upvotes: 1