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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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