title: Generate all possible combinations for 3 Columns in Google Sheets
body: <p>I have a Google Spreadsheets with four columns.</p>
  
  <p><a href="https://i.stack.imgur.com/FaNY0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FaNY0.png" alt=""></a></p>
  
  <p>I need to populate the Column D with all the possible combinations of the values in Columns A and C. Please take a look a the capture to see what I mean.</p>
  
  <p>I found this following formula, but it use for 2 column.but i have 3 column.</p>
  
  <p>i am using this code:</p>
  
  <pre><code>=ArrayFormula(transpose(split(concatenate(rept(A1:A&amp;char(9),counta(B1:B))),char(9)))&amp;" "&amp;transpose(split(rept(concatenate(B1:B&amp;char(9)),counta(A1:A)),char(9))))
  </code></pre>