Sorting by date

Lopsie96

New Member
Joined
Apr 27, 2016
Messages
6
Hi,

I have exported a file as a CSV that includes dates and other information. Upon export, the dates are not in chronological order and I cannot seem to get them sorted into chronological order. I don't know what I am doing wrong. I also do believe that the dates are stored as text but can't seem to understand how to get them converted to date format even though I have highlighted the column and formatted as a date. Can someone help??
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

joshman108

Active Member
Joined
Jul 6, 2016
Messages
310
In a separate column, you can use the DATE function to convert the text value to a date format (you will need to parse it out from the text, let me know if you need help - include sample data from your workbook). You should then be able to sort on this new date column.
 
Last edited:

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,127
Office Version
365, 2010
Platform
Windows, Mobile
Try selecting the column, click "Data" tab - click "Text To Columns" - select "Delimited" and click "Next", make sure "Other" is not checked and click "Next", select General and click "Finish"

There is a date option at the last stage if your date needs further adjustment rather than just the General option (only specifying General to start with as you sometimes have to use the reverse m/d to what you think depending on your region and you haven't stated what your date format is).
 
Last edited:

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
52,199
Office Version
365
Platform
Windows
I also do believe that the dates are stored as text but can't seem to understand how to get them converted to date format even though I have highlighted the column and formatted as a date.
Changing the format of a column of existing data will not convert the data, it just changes the format of the data (and date and other custom formats only apply to numeric data, not text data).

If the date column is already in a format which can be converted to a valid date, then you can simply select that column, go to the Data menu and select "Text to Columns", go to step 3 and choose the Date option with the proper date format, and click Finish. That will convert the Text entries to valid Dates.

If that does not work, please post a few sample of what these date entries look like.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
52,199
Office Version
365
Platform
Windows
You are welcome.
Glad we were able to help!
:)
 

Watch MrExcel Video

Forum statistics

Threads
1,090,383
Messages
5,414,120
Members
403,515
Latest member
see_mido

This Week's Hot Topics

Top