0

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?

player0
  • 124,011
  • 12
  • 67
  • 124
Artur Müller Romanov
  • 4,417
  • 10
  • 73
  • 132

3 Answers3

2

Try this:

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

example

Marios
  • 26,333
  • 8
  • 32
  • 52
0

or try:

=INDEX(TEXTJOIN(",", 1, UNIQUE(TRIM(FLATTEN(SPLIT(A1, ","))))
player0
  • 124,011
  • 12
  • 67
  • 124
0

This shorter one also works

=JOIN(", ",UNIQUE(TRANSPOSE(SPLIT(A1,", "))))

enter image description here

marikamitsos
  • 10,264
  • 20
  • 26