if you don't mind to use helper cells (with limited or fixed length , length of string effect number of formulas)
please try
B1
=SUBSTITUTE(CONCATENATE(P1,Q1,R1,S1,T1,U1,V1,W1,X1,Y1)," ","")
E1
=MID($A1,COLUMNS($D1:D1),1)&" "
copy thru N1
P1
=INDEX($E1:$N1,1,MATCH(SMALL(CODE($E1:$N1),COLUMNS($O1:O1)),CODE($E1:$N1),0))
follow with Ctrl-Shift-Enter for array formula, copy to Y1
Regards.
Bookmarks