parse difficult date/time string in excel table formula - excel

I have date/time text values in a column of an excel table. Ignore the quotation marks...
"October 1, 2020 6:00 pm"
"October 2, 2020 6:00 am"
Excel does not parse this automatically as a date/time.
What formula will allow me to parse this to a date/time excel represents as a true date/time
Cheers

If above information is in string format and consistent as depicted then below formula can be used.
For date:
=DATEVALUE(LEFT(A1,FIND(":",A1,1)-3))
For time:
=TIMEVALUE(MID(A1,FIND(":",A1,1)-2,99))
If data is in actual date time then following can be used.
For date:
=INT(A1)
Format cell in date format.
For time:
=A1-INT(A1)
Format cell in time format.
Edit:
You can try below formula which is rather unwieldy. It should work irrespective of locale.
=DATE(TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",99)),2*99,99))+0,LOOKUP(99,SEARCH(TEXT(1+ROW($A$1:$A$12)*29,"mmmm"),A1,1),ROW($A$1:$A$12)),TRIM(MID(SUBSTITUTE(SUBSTITUTE(A1," ",REPT(" ",99)),",",REPT(" ",99)),99,99))+0)

Related

How to change numbers to date in a composite formula in excel

I wanted the output Today's date: 04 January 2021 and used the formula ="Today's date: "& TODAY() but the output was Today's date: 44200. How do I change this to date format?
I tried the following:
Change the cell format using Home>> Number>> General to Date
Using the text to columns option Data>> Data tools>> Text to columns
Using the format cells and setting the format type as "dd-mm-yyyy". I know that gives output as something like 04-01-2021 but at least that would be an improvement.
with TEXT:
="Today's date: "& TEXT(TODAY(),"DD MMMM YYYY")

How to convert time stamp with text into a date

My data is extracting to this format May 22 2020 6:29PM
How do you convert this into 22/05/2020?
I have gotten the formula to this point =+LEFT(E12,LEN(E12) - FIND(" ",E12)-4) but cannot get it any further.
Try the following:
=DATEVALUE(SUBSTITUTE(LEFT(E12,FIND("~",SUBSTITUTE(E12," ","~",3)))," ",", ",2))
and apply the date format dd/mm/yyyy to the cell:
Note that this discards the time portion of the original date/time.

excel date format MMYYYY

i have fiscal date MMYYYY that needs to be converted to a date mm/dd/yyyy. Since I don't have date in original data I can use 01 for entire column. I have tried text to columns and have been unsuccessful.
It can also me converted as mm-dd-yyyy or in any order as long as sepearated by - or a /
You have to parse the text. If you have your date as Text formatted 'MMYYYY' in cell A1:
=DATE(RIGHT(A1,4),LEFT(A1,2),1)

Convert cell value to DateTime

I have a row of cells in Excel filled with datetimes in the following messy format: July 13, 2016 at 12:10AM. I want to convert this to 2016/07/13 12:10 ('yyyy/mm/dd hh:mm' in the 24h format). Can I do this using a formula or should I write a vba code for this?
Two issues:
First you must remove the at
Second you need a space between the time and the AM or PM
The follow formula will turn it into a date/time:
=--SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"at",""),"AM"," AM"),"PM"," PM")
Then you can format the cell with the custom format:
yyyy/mm/dd hh:mm

Excel 2013 date format conversion. 30 Jan, 15 18:02:05 to 30.01.2015

In MS Excel 2013 I import a CSV file, no matter if I format it using the delimined or any other option the results are the same. My date in Excel looks like: 30 Jan, 15 18:02:05 in a single cell. All I need is to convert it to a date format 30.01.2015 for example. I have a column of these and need to convert the values at once. (I tried TEXT, DATE, MID, DATEVALUE, MONTH, DATEVALUE...) but none of them are able to convert the date format. Also it does not matter if I convert it with format cells...to date it always displays the same i.e. 30 Jan, 15 18:02:05
Not sure what I am doing wrong. Getting a bit frustrating, thanks for any advice. Most of the above give a #VALUE error.
With data in A1 in B1 enter:
=DATEVALUE(LEFT(A1,FIND(" ",A1)-1) & "-" & MID(A1,FIND(" ",A1)+1,3) & "-20" & MID(A1,FIND(",",A1)+2,2))
and format B1 as dd.mm.yyyy for example:

Resources