Unable to sort dates from oldest to newest

blackystrat

New Member
Joined
Aug 5, 2014
Messages
26
Hi


So here is the situation. I have an excel 2007 spreadsheet that has a column with dates that I need to sort from oldest to newest or vice versa.


Here's what I did so far:


1. Did Text-to-Column > Finish
2. Even after step #2, I was still unable to sort them from oldest to newest.
3. So I went to Text-to-Column > Next > Selected Date (DMY) > Finish
4. The column still wouldn't sort date wise. So I repeated the above process #4 and this time, I changed the date format to MDY and back again to DMY
5. This time I was getting the sort from Oldest to Newest option but all the dates didn't switch back to the same format. Some remained in mm/dd/yyyy while some changed to dd/mm/yyyy


The weird thing is that, if after I perform step #2 and copy the column to a new sheet, I would immediately get the sort datewise option right away, but it isn't happening on the existing sheet.

Sample sheet attached at - datessample.xlsx - Send Files Online - TempSend.com


Kindly advise where I am going wrong


Hope I was able to explain my situation properly
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I am not able to access file-hosting sites, so cannot see your file. But your dates are probably not real dates, but text that looks like a date.

Test with =ISNUMBER(cell-ref)...FALSE indicated text dates, and we will need to convert them
 
Upvote 0
Hi,

All your dates in Column A are text, so you are correct to do "Text to Columns"; however, all your dates are in the format of MDY, so in your OP Step 4, don't change it back to DMY, and it should work.
 
Upvote 0
Hi,

All your dates in Column A are text, so you are correct to do "Text to Columns"; however, all your dates are in the format of MDY, so in your OP Step 4, don't change it back to DMY, and it should work.

Many thanks for your response.

After I did text to column with date format selected as MDY, I wasn't getting the sort Oldest to Newest option, but when I switched it to DMY, that option was enabled.

Any idea why that was happening?

Thanks
 
Upvote 0
I am not able to access file-hosting sites, so cannot see your file. But your dates are probably not real dates, but text that looks like a date.

Test with =ISNUMBER(cell-ref)...FALSE indicated text dates, and we will need to convert them

Thanks Ford. I will check this and revert
 
Upvote 0
Many thanks for your response.

After I did text to column with date format selected as MDY, I wasn't getting the sort Oldest to Newest option, but when I switched it to DMY, that option was enabled.

Any idea why that was happening?

Thanks

Can't answer your question because I used your uploaded file to test, and it's all working using MDY...
 
Last edited:
Upvote 0
I am not able to access file-hosting sites, so cannot see your file. But your dates are probably not real dates, but text that looks like a date.

Test with =ISNUMBER(cell-ref)...FALSE indicated text dates, and we will need to convert them

Hi Ford

I ran the formula and it returned as False

Please advise.

Thanks
 
Upvote 0
Hi Ford

I ran the formula and it returned as False

Please advise.

Thanks

That =ISNUMBER(Cell reference) Test is to check if the cell contains Text or Number, and I already told you your dates are Text in post #3...

The quickest and easiest way to convert the Text dates to Real dates is by "Text to Columns", but apparently, that's failing you...

So:


Excel 2010
AB
1Admitted
204/10/19794/10/1979
310/18/197310/18/1973
410/22/199010/22/1990
504/25/19904/25/1990
606/20/19696/20/1969
712/20/197412/20/1974
806/10/19686/10/1968
910/18/197310/18/1973
1011/19/197611/19/1976
1104/10/19784/10/1978
1211/12/198711/12/1987
1310/27/197510/27/1975
1412/02/196812/2/1968
1509/24/19979/24/1997
1609/20/19909/20/1990
1705/22/19755/22/1975
1804/26/19914/26/1991
1901/05/19791/5/1979
2004/17/20014/17/2001
2110/29/198210/29/1982
2205/31/19775/31/1977
2311/18/198311/18/1983
2406/23/20056/23/2005
2510/05/198710/5/1987
2611/02/198411/2/1984
2704/27/19944/27/1994
2809/16/19889/16/1988
2905/22/19755/22/1975
3010/10/200310/10/2003
3106/20/19856/20/1985
3211/19/197611/19/1976
3311/16/197811/16/1978
3411/19/197611/19/1976
3510/06/197210/6/1972
3609/22/19899/22/1989
3704/15/20024/15/2002
3802/04/19912/4/1991
3907/05/19797/5/1979
4012/05/197812/5/1978
4106/03/19836/3/1983
4209/18/19789/18/1978
4311/01/197911/1/1979
4406/19/19896/19/1989
4510/07/199410/7/1994
4610/31/198010/31/1980
4710/16/198610/16/1986
4812/31/199112/31/1991
4909/16/19839/16/1983
5010/18/198410/18/1984
Sheet1
Cell Formulas
RangeFormula
B2=DATE(RIGHT(A2,4),LEFT(A2,2),MID(A2,4,2))

Formula copied down.
 
Last edited:
Upvote 0
What does your data look like, and where does it come from?

The data is a list of professionals obtained from the public directory of an organization. It has multiple columns like name, address etc and the date column is of their admission dates to that specific organization.

When I run text-to-column > next > date, the default date format appears as DMY (even though the dates are actually in MDY)

f2q3vt.jpg


When I click finish and try to sort again, it doesn't give me the option to sort date wise.

If I change the format to MDY, then the format reverses and it makes it dd/mm/yyyy. Please check the screenshot below showing the column before (red) and after (green) the text-to-column > date (MDY) sort.


1WoFVnJx.png


So things are actually working in reverse for me here.

I ran the formula
Code:
[COLOR=#574123]=DATE([/COLOR][COLOR=Blue]RIGHT([COLOR=Red]A2,4[/COLOR]),LEFT([COLOR=Red]A2,2[/COLOR]),MID([COLOR=Red]A2,4,2[/COLOR])[/COLOR][COLOR=#574123])[/COLOR]
but it didn't return proper results

1WoU8xV1.png


So either something is wrong with the way my excel is working or what I am doing to sort these out. I will try this using Office 2010 on my laptop and let you guys know

Thank you very much for your help so far
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,723
Messages
6,174,111
Members
452,544
Latest member
aush

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top