title: Merge unique values if another cell matches
body: <p>Merge all unique values if another cell matches. I already know how to merge cells but now some information is double. So what I would like to achieve is the following: </p>
  
  <blockquote>
    <p>if column A has the same name, then all values given in column B for
    that name must be given only ONCE in a new column.</p>
  </blockquote>
  
  <p>My data has a row <code>names</code> and a row <code>mode</code>, for example (Row 1 is header)</p>
  
  <pre><code>     A      B    
  2  Brenda   a
  3  Brenda   a
  4  Joey     a
  5  Joey     b
  </code></pre>
  
  <p>So I want:</p>
  
  <pre><code>     E      
  2    a
  3  
  4   a,b
  5  
  </code></pre>
  
  <p>I already did merge the modes in column 3:</p>
  
  <pre><code>=IF(A1&lt;&gt;A2;B2;C1&amp;","&amp;B2)
  </code></pre>
  
  <p>So I get in this example:</p>
  
  <pre><code>     C      
  2    a
  3   a,a
  4    a
  5   a,b 
  </code></pre>
  
  <p>Then, I already did that only the first record get the additional modes in column 4:</p>
  
  <pre><code>=IF(A1=A2;"";INDEX(Sheet1!$C:$C;COUNTIF(Sheet1!$A:$A;$A2)+MATCH($A2;Sheet1!$A:$A;0) -1))
  </code></pre>
  
  <p>So I get in this example</p>
  
  <pre><code>     D      
  2    a,a
  3  
  4    a,b
  5  
  </code></pre>
  
  <p>Now I need a column that only uniques values are given for each name. So in this example:</p>
  
  <pre><code>     E      
  2    a
  3  
  4    a,b
  5  
  </code></pre>