Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a list of csv in a single cell, and I need to get the unique values from that list and put them in another cell. For example, in one cell I would have:

DIV-154, FOD-371, UDL-913, DIV-154

And in another cell I would like to get this as output:

DIV-154, FOD-371, UDL-913

I am aware of the Text to Columns and Remove Duplicates functions, but neither of these are quite what I want. Also, this can only be in Function form, it cannot be VBA.

As a closing note, I have searched for an answer to this question to no avail. If it exists somewhere on this site, I apologize and would appreciate a link to that thread.

share|improve this question

After Text to Columns and assuming data is then in ColumnsA:D starting in Row2, this should work (copied down as appropriate):

=A2&IF(B2<>A2,", "&B2,)&IF(AND(C2<>B2,C2<>A2),", "&C2,)&IF(AND(D2<>C2,D2<>B2,D2<>A2),", "&D2,)

It just strings together, with a comma and a space in between, each unique entry for each row.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .