Search code examples
google-sheetsgoogle-sheets-formula

Google Sheets formula to convert FROM ordinal dates TO standard dates


I am looking for a formula that will automatically convert a column of ordinal date/time values into standard date/time values.

July 1st 2022 6:48:49 pm
July 2nd 2022 10:03:35 am
July 3rd 2022 5:41:12 pm
July 4th 2022 2:44:13 pm

I need to get those reformatted to eliminate the st, nd, rd, and th portions.

Sheet


Solution

  • You can use

    =INDEX(IF(A2:A7="",, REGEXREPLACE(A2:A7,"st|nd|rd|th","")*1))
    

    You can then format as you like

    (Do adjust the formula according to your ranges and locale)

    enter image description here

    Functions used: