Forum Discussion

sp3124's avatar
sp3124
Copper Contributor
Aug 09, 2021
Solved

Date Formatting

I have a data in which data is represented in the following format : 1st Aug 2021 | 8:57 pm   I want to change this into 08/01/2021 8:57:00. I have tried using text to columns, custom data ...
  • HansVogelaar's avatar
    Aug 09, 2021

    sp3124 

    If it's OK to use a formula to return a date/time value in another cell:

    With a text value in A2, enter the following formula in B2:

    =--SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"st",""),"nd",""),"rd",""),"th",""),"|","")

    Format B2 with your preferred date/time format, then fill down.

     

    If you want to convert the value in the cell itself, it would require VBA.

Resources