Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.