title: Creating a list of unique pairs from a list of multi-value combinations in a Google Spreadsheet
body: <p>I have a bunch of rows in a Google Spreadsheet that look as such:</p>
  
  <pre><code>a,b,c,d
  a,d
  c,d
  b,d,f
  a,b,f,g,h,i
  q,b,b
  </code></pre>
  
  <p>...And on.</p>
  
  <p>I need a way to create a unique list of related pairs in this format:</p>
  
  <pre><code>a,b
  a,c
  a,d
  b,c
  b,d
  c,d
  b,f
  d,f
  a,f
  a,g
  a,h
  a,i
  </code></pre>
  
  <p>...And on.</p>
  
  <p>Any idea how I'd do that? I'm open to answers using Google Spreadsheet's scripting language, Excel 2004's scripting language or something else like PHP.</p>
  
  <p>Thanks!</p>