I have a column of dates in the format of Mmm. dd, yyyy that I'm trying to split into three separate columns, ones for day, month, and year.
I've tried the DATEVALUE function but it tells me that my input is in an improper format.
Solution 1 - Using formula
If your original date is always in the described structure, such as " Dec. 9, 2016 ", " Jan. 31, 2018 ", or " Jun. 25, 2017 ", then you can use excel formulas to find YEAR, DAY, and MONTH consecutively.
Here are the formulas:
To find YEAR: =--RIGHT(A2,4)
To find DAY: =--TRIM(MID(A2,LEN(A2)-7-MOD(LEN(A2),12),LEN(A2)-10))
To find MONTH: =MONTH(DATEVALUE(D2&"-"&LEFT(A2,3)&"-"&B2))
Solution 2 - Using Power Query
Alternatively, you can use Power Query to automatically recognize your original data as dates and split them into three columns as desired. See below steps:
Please note you need to have Excel 2010 or later versions to be able to use Power Query Editor.
Cheers :)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.