• 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.

Dates (not really dates) not sorting properly

Hi,

I have a sheet with a column of "dates". I need to be able to sort the dates, but cannot do it since the dates aren't really dates. The problem is that I do not know how to make them dates. I have tried several things including Text to Columns, but nothing has worked so far.

I have attached a sample portion of the file (dates in column G). Any help would be greatly appreciated.

Thank you!
Carlos
 

Attachments

  • Sample File_Dates.xlsx
    27.9 KB · Views: 13
How is the data brought into Excel?

Following formula will fix most of them.
=IF(ISNUMBER(G2),G2,DATE(20&RIGHT(G2,2),MONTH((MID(G2,4,3)&"/1")*1),LEFT(G2,2)))

But there's few that lack "-" or "/" between date and month part, and will not resolve with above.

You can add additional operation to above formula (or have month short name list and perform lookup using it). But I'd recommend enforcing appropriate data entry process rather than trying to fix the data format after the fact.
 
How is the data brought into Excel?

Following formula will fix most of them.
=IF(ISNUMBER(G2),G2,DATE(20&RIGHT(G2,2),MONTH((MID(G2,4,3)&"/1")*1),LEFT(G2,2)))

But there's few that lack "-" or "/" between date and month part, and will not resolve with above.

You can add additional operation to above formula (or have month short name list and perform lookup using it). But I'd recommend enforcing appropriate data entry process rather than trying to fix the data format after the fact.

This is awesome! Thank you so much.

If you have the time, I would really appreciate it if you could explain how your formula works. I am particularly interested in the DATE and MONTH functions.

Thanks again!
 
Back
Top