2017-05-09 61 views

回答

0

有了公式:

=--(LEFT(A1,MIN(SEARCH({"th","st","nd","rd"},A1 & "thstndrd"))-1)&" " & MID(A1,MIN(SEARCH({"th","st","nd","rd"},A1 & "thstndrd"))+3,LEN(A1))) 

這是陣列式和需要用Ctrl-Shift-Enter確認。

然後格式dd/mm/yyyy

enter image description here

2

文本中A1是:

=DATEVALUE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"th",""),"st",""),"nd",""),"rd","")) 
0

你可以給這個公式以及一試,

=IF(ISNUMBER(VALUE(LEFT(A1,2))),TEXT(REPLACE(A1,3,2,""),"mm/dd/yyyy"),TEXT(REPLACE(A1,2,2,""),"mm/dd/yyyy"))

的公式查找在前兩位的數值並格式化相應的日期。該公式的優點是,您可以根據需要修改mm/dd/yyyy格式。沒有必要改變單元格的格式。

enter image description here

相關問題