[excel] Getting unique values in Excel by using formulas only

I ran into the same problem recently and finally figured it out.

Using your list, here is a paste from my Excel with the formula.

I recommend writing the formula somewhere in the middle of the list, like, for example, in cell C6 of my example and then copying it and pasting it up and down your column, the formula should adjust automatically without you needing to retype it.

The only cell that has a uniquely different formula is in the first row.

Using your list ("red", "blue", "red", "green", "blue", "black"); here is the result: (I don't have a high enough level to post an image so hope this txt version makes sense)

  • [Column A: Original List]
  • [Column B: Unique List Result]
  • [Column C: Unique List Formula]

    1. red, red, =A3
    2. blue, blue, =IF(ISERROR(MATCH(A4,A$3:A3,0)),A4,"")
    3. red, , =IF(ISERROR(MATCH(A5,A$3:A4,0)),A5,"")
    4. green, green, =IF(ISERROR(MATCH(A6,A$3:A5,0)),A6,"")
    5. blue, , =IF(ISERROR(MATCH(A7,A$3:A6,0)),A7,"")
    6. black, black, =IF(ISERROR(MATCH(A8,A$3:A7,0)),A8,"")