Home > OS >  How to array unique in google spreadsheet?
How to array unique in google spreadsheet?

Time:10-06

I have data like this:

Cage Type
Open House, Open House

How to make it like this? so I can get a unique list.

Cage Type Unique Cage
Open House, Open House Open House

CodePudding user response:

try:

=INDEX(FLATTEN(REGEXREPLACE(TRIM(QUERY(QUERY(QUERY(SPLIT(UNIQUE(FLATTEN(
 FILTER(ROW(A:A)&"​"&SPLIT(A:A, ", ", )&",", A:A<>""))), "​"), 
 "select max(Col2) where Col2<>',' group by Col2 pivot Col1"), 
 "offset 1", ),,9^9)), ",$", )))

enter image description here

CodePudding user response:

Use this

=TEXTJOIN(", ",1,UNIQUE(TRANSPOSE(SPLIT(A2, ", ",0))))

enter image description here

Arrayformula

=BYROW(A2:A, LAMBDA(r, IFERROR(TEXTJOIN(", ",1,UNIQUE(TRANSPOSE(SPLIT(r, ", ",0)))),"")))

enter image description here

  • Related