Forum Discussion
A.J. Buck
Feb 12, 2018Copper Contributor
Date Formatting
Greetings,
I have a column of dates from a system which is in a GENERAL format. The problem is, the system does not provide a day in the date; data is in mmmyy format (IE: APR19).
The p...
A.J. Buck
Feb 12, 2018Copper Contributor
I did that, and it converts to text fine.
I think I should have gave more info.
The report I am working with is a list of individuals, training courses, and due dates. The due dates are expressed in a general formatted column as mmmyy, with no day. I am trying to create a product that I can copy the data into, and have a series of conditional formatting and other things tell me who is due/overdue for what so I can more easily see who I need to schedule for what.
If the dates are not in a date format excel will recognize, this will not work.
If I were to try to change APR19 to a date format excel would think 19 is the day when it is the year. What would help the most is if I can somehow convert APR19 (along with all the other dates in the column (IE: MAR18, DEC17, etc.)) to 1APR19 (and 1MAR18, 1DEC17, etc) I could make progress.
Converting general to text doesn't really help. Thank you for the reply though. I didn't know CTRL+1 was a shortcut for Format...I will definitely be using that in the future. :)
Haytham Amairah
Feb 12, 2018Silver Contributor
Ok, I have another solution!
Get rid of the text format that I have suggested in the previous answer!
Take the dates which are formatted as MMMYY, and put them in Excel.
After Excel convert the years to days, you can fix that by using this formula
=DATE(20&DAY(A1),MONTH(A1),1)
The result of this formula is an actual date, not text!
Not you got the correct dates, but the format of them may not as you want (DMMMYY), but you can convert them to this format as follows:
- Highlight them and press Ctrl+1.
- Go to Custom category.
- Put this format in the Type box: dmmmyy
- Hit OK.
- A.J. BuckFeb 12, 2018Copper Contributor
GREAT! that did what I want!
The only difficulty now is ill have to create a new column in the table for the new values to apply to. Unless you know of a way I can run a script on a column without having the equations embedded in the cells themselves...
Thank you very much for your help!
- Haytham AmairahFeb 13, 2018Silver Contributor
I have another solution for you to fix the column of date in place without using a formula in a helper column!
You can use it if the existing dates that you have are already formatted as texts in this format (MMMYY)!
Please find the attached file, and download it!
It contains a macro that you can run to fix the column of dates in place.
To use it, highlight the dates and go to View >> Macros >> View Macros.
Find the macro that named "convert", and then hit Run button.
Remember to highlight the dates before you run the macro.
- SergeiBaklanFeb 12, 2018MVP
By the way, I tried Power Query (aka Get & Transform) - it transforms correctly, just couple of clicks (get source data from table/range and load the result back into the Excel sheet)
with very simple code automatically generated
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}}) in #"Changed Type"
- A.J. BuckFeb 12, 2018Copper Contributorlooks good, but I don't think 2013 has PQ. Unless you download it...unfortunately, where I work, we are not able to download add ons and upgrades until the company approves everyone upgrade to 2016.