Search code examples
excelexcel-formuladate-conversion

Parsing non-standard date format in Excel cell


I want to convert dates formatted like "March 30th 2017, 05:00:00.000" to an excel date value? What's the most elegant solution I can do this with using a cell-formula and not VBA?


Solution

  • This will do the standard "rd","th","st","nd"

    =--(LEFT(A1,MIN(FIND({"rd","th","st","nd"},A1 & "thrdstnd"))-1)& ", " & SUBSTITUTE(MID(A1, MIN(FIND({"rd","th","st","nd"},A1 & "thrdstnd"))+2,LEN(A1)),",",""))
    

    You can add other suffixes as you need to the formula

    enter image description here

    Then you can format it as you like.