+ Reply to Thread
Results 1 to 11 of 11

Sort Values That Look Like Dates

  1. #1
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Sort Values That Look Like Dates

    As an pretty experienced Excel user I am almost embarrassed to post this problem.

    I am having a terrible time sorting some stock numbers that look like a date. The first item looks like April 1 and there seems to be no formatting I can apply that will make it sort properly so that it appears in between the other two values.

    APR01
    ABD01
    ARS01

    I know I am missing something...or am I?

    Thanks!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Sort Values That Look Like Dates

    When I copied your data, it changed APR01 to 4/1/2014. Not sure where your data is coming from, but to overcome that, I added ' and then typed it in. You could get the same affect if you formatted your cells to text before entering the data. It should sort fine after that
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Sort Values That Look Like Dates

    I know about adding the apostrophe but that can mess up formulas. And formatting as text does NOT change the sort. I thought text format would do the trick but apparently Excel insists internally that apr01 is a number and sticks it ahead of text.

    Any other ideas?

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Sort Values That Look Like Dates

    Thats why I said to format as text BEFORE you enter your data. If the data is already there, formatting has no affect on the contents

  5. #5
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Sort Values That Look Like Dates

    Um, sorry, I tried that. I would love to have you try it too. I formatted empty cells as text, entered the data, sorted...no joy. Give it a try. This is really frustrating.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Sort Values That Look Like Dates

    It sorts just fine for me....
    ascending...
    I
    4
    ABD01
    5
    APR01
    6
    ARS01

    descending...
    I
    4
    ARS01
    5
    APR01
    6
    ABD01



    Upload a sample please?

  7. #7
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Sort Values That Look Like Dates

    Choose "Sort"(not the ascending /descending one) Option
    Continue with current selection...
    OK
    Theb
    Sort Numbers and Numbers Stored as Text separately





    (1000...post)
    Last edited by RobertMika; 01-03-2014 at 09:09 PM.
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  8. #8
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Sort Values That Look Like Dates

    Aha! I am the lazy type that has the sort buttons on my quick access toolbar and clicking ascending or descending gave improper results. I needed to use the full sort facility to get the prompt that Robert mentioned.

    Thanks for the help!

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Sort Values That Look Like Dates

    Congrats in 1k posts Robert!!!

    @ snapfade, happy to help and thanks for the feedback

  10. #10
    Forum Contributor
    Join Date
    10-08-2012
    Location
    San Clemente, California
    MS-Off Ver
    Office365
    Posts
    383

    Re: Sort Values That Look Like Dates

    Congrats indeed, Robert. Thanks for sharing your knowledge.

  11. #11
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Sort Values That Look Like Dates

    Thank you Ford and snapfade!

+ 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. Replies: 2
    Last Post: 10-21-2013, 07:55 PM
  2. Replies: 7
    Last Post: 05-02-2013, 09:50 PM
  3. VBA to sort various dates into values
    By luk3333 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-05-2013, 07:40 PM
  4. [SOLVED] Request a Macro to Convert data into Dates (Multiple Dates Values separated by Line)
    By seenai in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2012, 02:28 AM
  5. Replies: 1
    Last Post: 06-22-2005, 10:05 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