I have some values in A1:G1 (a,a,b,c,c,d,d), they are all letters. and in H1, I try to get this result (acd). I want to join only the values that repeat twice ore more. So it should be omitted if there is a single value.
I wrote this formula : =TEXTJOIN(,TRUE,IF(COUNTIF(AY4:BD4,"a")>1,"a",IF(COUNTIF(AY4:BD4,"b")>1,"b",IF(COUNTIF(AY4:BD4,"c")>1,"c",IF(COUNTIF(AY4:BD4,"d")>1,"d","")))))
but it doesn't work. I am not sure if textjoin works this way. I'd be glad if anybody can give me a solution. thanks.
Note: if the values are like this (a,a,a,a,a,b,c), then the result should be (a).
Use this as an array formula:
=TEXTJOIN(",",TRUE,IF((COUNTIFS(A1:G1,A1:G1)>1)*(COLUMN(A1:G1)-COLUMN(A1)+1=MATCH(A1:G1,A1:G1,0)),A1:G1,""))
Being an array formula is needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.