C2=TEXTJOIN(““,IF(MATCH(MID(A2,ROW(“1:“& amp;LEN(A2)),1),MID(A2,ROW(INDIRECT(“1:“& amp;LEN(A2)),1)= ROW(INDIRECT(“1:“& amp;LEN(A2))、MID(A2、ROW(INDIRECT(“1:“& amp;LEN(A2))(1)““))