textjoin issues

Copper Contributor

I would like to list the unique values for each row as an output, separated by a comma

 

Example

 

Consider cells A2=b B2=b C2=d

 

I use the below formula and get cell D2 b,d

Duplicates are removed as well

 

=TEXTJOIN(",",TRUE,IF(A2:C2<>"",IF(COLUMN(A2:C2)=MATCH(A2:C2,A2:C2,0),A2:C2,""),""))


But if I start from B2=b C2=b and D2=d and use the formula in E2, it doesnt work, I am using Column A for some other purpose

Based on the information shared above, I want my formula to work fine, when I insert a column in column A

1 Reply

@vishu1204 , that's as

=TEXTJOIN(",",TRUE,IF(B2:D2<>"",IF(COLUMN(B2:D2)+1-COLUMN(B2)=MATCH(B2:D2,B2:D2,0),B2:D2,""),""))