• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Date formats

JEC8878

New Member
Hi All

Is there a way you can convert date - Mon 25 Mar - to - 25/03/24 and copy formula down for hundreds of dates
 
i have attached the file - it is the highlighted part im needing to convert - i have a whole load of files with dates like this that need changing so anything that will help would be greatly appreciated thank you
 

Attachments

  • Example.csv
    3.5 KB · Views: 12
Copy the formula and enter in E2 and drag it down.
=IFERROR(DATE(2024,XLOOKUP(RIGHT(A2,3),{"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov";"Dec"},{1;2;3;4;5;6;7;8;9;10;11;12},""),TRIM(MID(A2,SEARCH(" ",A2)+1,2))),"")
change the cell format to Short Date
 
Since the data is stored in a csv, I reckon there is an issue with importing the data.
If you have a version of Excel that's 2010 or beyond, there is no need for a formula.

Data -> From CSV - > Transform Data.

With the standard settings of Power Query, this is the result.

1715591762380.png

You can close and load this as a table in Excel. With a bit of extra steps, you can completely clean this up, simply by clicking some buttons in the UI.
1715592106366.png

This creates a "refreshable" solution. If you would save the new csv in the same place and with the same name, it will work just like this.

If you want to keep all the files, you can start from Data -> From File From Folder -> then as first step, click the column named Date Created and from the filter options select Date/time Filters and go for the option Is Latest. Drill down on the Binary column (click on the green word "Binary"). The following will happen.
1715592379463.png

EDIT:
You can also add a Fill Down step, for the lines where you have no date (even rows). I've done that in the uploaded excel file.
 

Attachments

  • Chandoo_csv_dates_import.xlsx
    28.4 KB · Views: 1
Back
Top