Sort excel date column in dd-mm-yyyy format

11,207

After selecting date and selecting sort anything that looks like a number, as a number it is sorting correctly. Earlier I was selecting sort numbers and numbers stored as text separately.

Share:
11,207

Related videos on Youtube

Mohammad Yusuf
Author by

Mohammad Yusuf

Updated on September 18, 2022

Comments

  • Mohammad Yusuf
    Mohammad Yusuf over 1 year

    I sorted a dd-mm-yyyy date column but it doesn't gets sorted correctly.

    This is how it looks like after sorting which is incorrect.

    01-03-2018
    02-02-2018
    03-02-2018
    03-03-2018
    03-03-2018
    04-03-2018
    04-03-2018
    04-12-2017
    04-12-2017
    05-03-2018
    06-02-2018
    06-12-2017
    

    Any tips?

    • Attie
      Attie almost 6 years
      Have you get the data type to "date"? Works fine for me.
    • Jeff Zeitlin
      Jeff Zeitlin almost 6 years
      Making sure that Excel thinks those are dates rather than strings is the best solution, but if for some reason they have to be strings, you should probably consider rearranging them to YYYY-MM-DD, which is guaranteed to be (a) non-ambiguous, and (b) properly sorted.
    • Rajesh Sinha
      Rajesh Sinha almost 6 years
      Are you sorting Lowest to Older to Newest or Newest to older?
    • Mohammad Yusuf
      Mohammad Yusuf almost 6 years
      Tried date. Doesn't work. Have to sort in ascending. This is just a sample. There are more rows.
    • Rajesh Sinha
      Rajesh Sinha almost 6 years
      @MYGz, Oldest to Newest is, Ascending and Newest to Oldest is Descending. I've tried you date it's working nicely !!
    • Mohammad Yusuf
      Mohammad Yusuf almost 6 years
      Ok after selecting date and selecting sort anything that looks like a number, as a number it is sorting correctly. Earlier I was selecting sort numbers and numbers stored as text separately.
    • Rajesh Sinha
      Rajesh Sinha almost 6 years
      Keep the date column either General or Short Date , basically Date value is Number, if you are talking data type.
    • Lee
      Lee almost 6 years
      Seems excel tread and sort the data as mm-dd-yyyy, where do you get the file? Go to Control Panel and check your system region, make sure you're using the dd-mm-yyyy date format as default.
    • fixer1234
      fixer1234 almost 6 years
      In Excel, you need to distinguish format from what's stored. Excel works with what's stored, not how it looks. You can format dates to appear however you want. Excel treats them chronologically. If you want a non-chronological sort based on the order of the date components as displayed, you need to convert the date to a text translation, then sort that. Your example is text strings rather than dates, and Excel is sorting the text starting from the left. You need to convert the data to Excel dates for Excel to handle it as dates.
    • phuclv
      phuclv about 4 years
      @Lee no the above dates are in text format so they're sorted lexicographically as text. That means dates within the same year will be sorted correctly. OTOH the yyyy-mm-dd format sorts correctly as text