As an alternative to your new formulas from Posts # 5 and # 6:
=IF(MID(REPLACE(TRIM(G12),4,2,""),3,2)="..",TEXT(MID(TRIM(G12),7,4)&"-"&MID(TRIM(G12),4,2)&"-"&LEFT(TRIM(G12),2),"dd-mmm-yyyy"),TRIM(LEFT(SUBSTITUTE(TRIM(G12)," ",REPT(" ",99),2),99)))
If you are sure there are no occasional double spaces and leading spaces in your strings, here is a lighter version:
=IF(MID(REPLACE(G12,4,2,""),3,2)="..",TEXT(MID(G12,7,4)&"-"&MID(G12,4,2)&"-"&LEFT(G12,2),"dd-mmm-yyyy"),TRIM(LEFT(SUBSTITUTE(G12," ",REPT(" ",99),2),99)))