excel date formatting not working

后端 未结 12 3015
-上瘾入骨i
-上瘾入骨i 2021-02-20 15:13

I have an excel sheet created by a 3rd party program.

One of the columns has dates in this format: \"Jan 19, 2015 03:00:00 PM\"

I would like these dates to appea

12条回答
  •  鱼传尺愫
    2021-02-20 15:30

    Given your regional settings (UK), and the inability of formatting to change the date, your date-time string is text. The following formula will convert the date part to a "real" date, and you can then apply the formatting you wish:

    =DATE(MID(A1,FIND(",",A1)+1,5),MATCH(LEFT(A1,3),{"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov";"Dec"},0),MID(SUBSTITUTE(A1,",","   "),5,5))
    

    Might be able to simplify a bit with more information as to the input format, but the above should work fine. Also, if you need to retain the Time portion, merely append:

    +RIGHT(A1,11)
    

    to the above formula.

提交回复
热议问题