Reputation: 1
I have a excel with date format as " Feb 1 2020 1:00AM "
I am trying to convert this format to " 08-10-2019 10:27:50 "
I have tried using text formula but date format remains same its not changing.
Upvotes: 0
Views: 63
Reputation: 152660
Feb 1 2020 1:00AM
is not a date format that Excel recognizes and as such it is a text string and not a number that can be reformatted.
One needs to parse the string to something that Excel will recognize: 1 Feb 2020 1:00 AM
This formula parses the string and turns it into a number that can be formatted as desired:
=--REPLACE(TEXTJOIN(" ",,FILTERXML("<a><b>"&SUBSTITUTE(A1," ","</b><b>")&"</b></a>","//b["&{2,1,3,4}&"]")),LEN(A1)-1,0," ")
Then format the date either: mm-dd-yyyy hh:mm:ss
or dd-mm-yyyy hh:mm:ss
depending on locale.
Upvotes: 1