Reputation: 95
I have a spreadsheet which contains the loading times for my website. I want to find the peak hour for my website.
However the dates are stored in the following format:
Jun 02, 2014 01:13:08 am
MMM DD, YYYY HH:MM:SS am / pm
How can I convert this in to date that excel will understand?
Upvotes: 0
Views: 5749
Reputation: 1
=TEXT(DATEVALUE(MID(A1,4,FIND(",",A1)-4)&"/"&MONTH(LEFT(A1,3)&1)&"/"&MID(A1,FIND(",",A1)+2,4))+TIMEVALUE(RIGHT(A1,8)),"dd/mm/yyyy hh:mm")
Upvotes: -2
Reputation: 11
Another solution - via change in windows regional settings.
Start with .CVS
file with date in MMM DD", "YYYY HH:MM:SS AM/PM
In windows 10, Open:
Control Panel > Clock and Region > Region
In long date, enter MMM dd,yyyy
> OK.
Reboot, then open the excel file, the text is recognized as date.
Upvotes: 0
Reputation: 96753
To convert your "pseudo-dates" into real dates, select them and run:
Sub ConvertDates()
Dim r As Range
For Each r In Selection
r.Value = CDate(r.Text)
Next r
End Sub
Upvotes: 4