title: Generate all possible combinations for Columns(cross join or Cartesian product)
body: <p>I have a Google SpreadSheets doc with three columns A, B and C.</p>
  
  <p>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.</p>
  
  <p>I found this to be done in Excel, <a href="https://www.mrexcel.com/forum/excel-questions/654871-how-generate-all-possible-combinations-two-lists-without-macro.html#post3246600" rel="noreferrer">here</a>, but it doesn't work in google spreadsheets.</p>
  
  <p>The formula should be useful even for more columns (e.g.: four instead of two)</p>
  
  <p>Can I do this?</p>
  
  <p><a href="https://www.mrexcel.com/forum/excel-questions/654871-how-generate-all-possible-combinations-two-lists-without-macro.html#post3246600" rel="noreferrer"><img src="https://i.stack.imgur.com/RoAYB.jpg" alt="enter image description here"></a></p>