title: Gathering all the unique values from one column and outputting them in another column..?
body: <p>I have this form of a spreadsheet:</p>
  
  <pre><code> A   B   C  D
  abc abc abc 1
  def ghi jkl 1
  mno pqr stu 3
  vwx yza bcd 4
  mno pqr stu 5
  mno pqr stu 5
  vwx yza bcd 5
  mno pqr stu 1
  </code></pre>
  
  <p>Where the first 3 columns are just data of type string. The column D has integers which has numbers repeating. My question is how to output a fifth column like so:</p>
  
  <pre><code> A   B   C  D E
  abc abc abc 1 1
  def ghi jkl 1 3
  mno pqr stu 3 4
  vwx yza bcd 4 5
  mno pqr stu 5
  mno pqr stu 5
  vwx yza bcd 5
  mno pqr stu 1
  </code></pre>
  
  <p>It only outputs the unique numbers from column D.</p>
  
  <p>I imagined running an if/else statement in a for or while loop that checks each cell in "D" and stores any value not previously "seen" in an array. Then outputting the array in column E.</p>
  
  <p>I was wondering if there is a more efficient way to do this. Also the above is just a small example. Most likely the data range is in the 400 range. (Row wise. Columns are only 4 or 5 including the new output column.)</p>
  
  <p>Thanks in advance.</p>
  
  <p>P.S.
  I searched for this here but I'm only getting questions that relate to deleting duplicate rows. If there is a question that asks this already, please link me to it.</p>