+ Reply to Thread
Results 1 to 4 of 4

How to sort dates correctly?

  1. #1
    Registered User
    Join Date
    09-28-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    86

    How to sort dates correctly?

    Hi, Excel-ers,

    I think this should be pretty simple, but I can't figure it out...
    Using Excel 2007, I made a column of Dates by:
    =MONTH(D1)&"/"&DAY(D1)
    and it looks like:
    1/11
    1/2
    1/23
    1/25
    1/5
    1/7
    11/1
    and the problem is... THAT's how they come out as Sorted !

    How can I get them sorted correctly?

    Thanks.

    Mark53
    Last edited by Mark53; 01-10-2011 at 07:39 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to sort dates correctly?

    As you are listing them they are Text Strings rather than Dates.

    To use Text strings you would need to Format the Month & Day with leading zeroes:

    Please Login or Register  to view this content.
    If you want them as dates use

    Please Login or Register  to view this content.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How to sort dates correctly?

    I should have added, the other alternative would be to sort via the formulae themselves.

    Dates are numbers so assuming you have no other numbers stored in Col D (other than the Dates):

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-28-2010
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: How to sort dates correctly?

    Thanks for your fast reply, Don.

    Excel says that the format of the cells is Date, not Number or Text or General.
    Regardless, I tried the Custom format idea...
    It sorted them including the Year (which is included in the column D dates).
    Many different years, so that didn't work.

    I thought I wanted them to remain as Dates, but apparently not.
    I used your =TEXT(D1,"mm/dd") idea, and it does exactly as I want.

    Terrific ! Thanks !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1