+ Reply to Thread
Results 1 to 4 of 4

sorting dates with letters

  1. #1
    Registered User
    Join Date
    02-09-2020
    Location
    USA
    MS-Off Ver
    2007
    Posts
    1

    sorting dates with letters

    How do I sort dates with letters? AFT 1992 should be after 1991 and before 2004. Instead, after sorting AFT 1992 is placed after 2003. To me, that's out of order


    1991
    2004
    AFT 1992
    BEF 2003



    This is how I originally entered the dates before sorting.


    1991
    AFT 1992
    BEF 2003
    2004

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,855

    Re: sorting dates with letters

    The results you are getting might be out of order for what you are thinking they mean, but Excel is sorting them perfectly. For sorting purposes, a cell is considered either a number or text or boolean. If they're mixed, then the numbers will be sorted first, then the text, then the boolean.

    For what you are doing you need to create a second column with the sort key, then use that for sorting. You can create the second column with the formula

    =VALUE(RIGHT(A1,4))

    then sort both columns, using the second column as the key.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.85 (24051214))
    Posts
    8,830

    Re: sorting dates with letters

    it will sort numbers before letters by default and will not see those entries necessarily as dates

    are all the letters 3 letters with a space

    you could try a helper column to sort
    and extract the letters

    would that help

    are all dates JUST a 4 digit year

    you have also posted here
    https://www.mrexcel.com/board/thread...tters.1123553/
    and cross posting - you should show so that people do not waste time when a solution may already be found on the other forum
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,855

    Re: sorting dates with letters

    Quote Originally Posted by etaf View Post
    you have also posted here
    https://www.mrexcel.com/board/thread...tters.1123553/
    and cross posting - you should show so that people do not waste time when a solution may already be found on the other forum
    Thank you for providing that link.

    Administrative Note:

    jrclinebell, there is no infraction because this is your first post but please take the time to review our rules. There aren't many, and they are all important.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sorting letters BEFORE numbers
    By Don Ivie in forum Excel General
    Replies: 8
    Last Post: 09-17-2016, 03:37 PM
  2. Sorting numbers and letters
    By sungen99 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-27-2015, 09:55 AM
  3. [SOLVED] Sorting numbers and letters
    By Larry.LeBlanc@O in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-22-2014, 05:42 PM
  4. Sorting numbers and letters
    By rockon0921 in forum Excel General
    Replies: 6
    Last Post: 04-21-2014, 03:15 AM
  5. [SOLVED] Sorting & counting letters
    By rosepinkfluff in forum Excel General
    Replies: 9
    Last Post: 01-05-2013, 08:11 PM
  6. Counting and Sorting letters
    By adienspade in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2012, 02:43 PM
  7. Excel 2007 : Sorting sensitive letters
    By freehawk in forum Excel General
    Replies: 3
    Last Post: 03-05-2010, 12:57 PM

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