Search code examples
google-sheetssplitconcatenationgoogle-sheets-formulatextjoin

How to filter cell for string reoccurrences/duplicates?


My sheet has a cell with content:

Tomato, Potato, Beef, Tomato, Salmon, Beef

I want to remove all reoccurring string elements of this cell so that the new cell shows this:

Tomato, Potato, Beef, Salmon

I've tried to achieve this with the UNIQUE and TEXTJOIN functions so far, without success. Is it possible to apply FILTER to a cell?


Solution

  • Try this:

    =TEXTJOIN(", ",true,UNIQUE(TRANSPOSE(SPLIT(substitute(A1," ",),","))))
    

    example