Converting String to Date in Excel

前端 未结 2 579
忘了有多久
忘了有多久 2021-01-24 07:19

I\'ve got date strings formatted this way: \"Tuesday, January 3, 2012\"

How can I convert them in a date format in Excel 2010?

Thank you in advance!

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-24 07:54

    What works can depend on regional settings. If you have US regional settings this formula will give a date based on your data in A1

    =TRIM(REPLACE(A1,1,FIND(",",A1),""))+0

    format in required date format

    This version should work on a wider range.....

    =TRIM(MID(A1,LEN(A1)-7,2)&REPLACE(REPLACE(A1,LEN(A1)-7,3,""),1,FIND(",",A1),""))+0

    Try this version which should work for Italian settings - [I assume the data is in English as shown, e.g. months are January, February etc.]

    =DATE(RIGHT(A1;4);SEARCH(MID(A1;FIND(",";A1)+2;3);"xxjanfebmaraprmayjunjulaugsepoctnovdec")/3;MID(A1;LEN(A1)-7;2))

提交回复
热议问题