Forum Discussion
ainganni
Dec 01, 2023Copper Contributor
converting text string to date time format
hi I would like to be able to sort some data I get by date and time, however the date field is expressed like so: May 15, 2023, 6:34:54 PM how can i convert this to a date time that excel recog...
- Dec 01, 2023
Assuming that all values use abbreviated month names Jan, Feb, etc. (May in your example is ambiguous!), try
=CONCATENATE(MID(F2,5,2),"",MID(F2,1,3),"-",MID(F2,9,4))+TRIM(RIGHT(F2,11))
Format the cell(s) with the formula as date and time.
You can also use Power Query (Data > From Table/Range). It will automatically convert the values to real date/time values.
HansVogelaar
Dec 01, 2023MVP
Assuming that all values use abbreviated month names Jan, Feb, etc. (May in your example is ambiguous!), try
=CONCATENATE(MID(F2,5,2),"",MID(F2,1,3),"-",MID(F2,9,4))+TRIM(RIGHT(F2,11))
Format the cell(s) with the formula as date and time.
You can also use Power Query (Data > From Table/Range). It will automatically convert the values to real date/time values.