+ Reply to Thread
Results 1 to 11 of 11

Sorting Column of Dates and Quarters

  1. #1
    Registered User
    Join Date
    07-26-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    23

    Sorting Column of Dates and Quarters

    How can I sort a column with dates in a standard date format and quarter format?
    Last edited by succel; 07-27-2010 at 01:07 PM.

  2. #2
    Registered User
    Join Date
    07-26-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Sorting Column of Dates and Quarters

    never mind. some simple if statements solve my problem!

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

    Re: Sorting Column of Dates and Quarters

    Yes, I was going to say you should convert the strings to dates in adjacent column and sort based on those values, ie:

    =IF(ISNUMBER(A1),A1,DATE(LEFT(A1,4),RIGHT(A1)*3+1,0))
    copied down

  4. #4
    Registered User
    Join Date
    07-26-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Sorting Column of Dates and Quarters

    exactly the solution. i appreciate your response. i guess explaining the problem helped me realize how easy the solution actually is!

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

    Re: Sorting Column of Dates and Quarters

    No problem - if you do come up with a solution yourself it's still good to post it for the benefit of others who may come across the thread at a later date (whilst trying to do something similar themselves).

  6. #6
    Registered User
    Join Date
    07-26-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Sorting Column of Dates and Quarters

    uh oh..now i have a new problem: some of the values in my list are "undetermined," which causes the if function to yield the "wrong data type" error message. how can i avoid this?

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

    Re: Sorting Column of Dates and Quarters

    How do you want them to be handled ?

    If you want them to appear last in your list then

    =IF(OR(ISNUMBER(A1),A1="undetermined"),A1,DATE(LEFT(A1,4),RIGHT(A1)*3+1,0))
    copied down

    sort based on output.

  8. #8
    Registered User
    Join Date
    07-26-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Sorting Column of Dates and Quarters

    that will work :D

    thanks, donkeyote!

  9. #9
    Registered User
    Join Date
    07-26-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Sorting Column of Dates and Quarters

    now on to figuring out the rest of the macro!
    Last edited by succel; 07-27-2010 at 03:50 PM.

  10. #10
    Registered User
    Join Date
    07-26-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Sorting Column of Dates and Quarters

    Actually, if I'd like the "undetermined" cells to be converted to the date 12/31/2100, what would I modify in =IF(OR(ISNUMBER(A1),A1="undetermined"),A1,DATE(LEFT(A1,4),RIGHT(A1)*3+1,0))?

    or could i insert another column and do a separate if statement to uncomplicate things? in this case, if it's a number copy it over and if it's not (undetermined) convert to 12/31/2100?
    Last edited by succel; 07-29-2010 at 12:58 PM.

  11. #11
    Registered User
    Join Date
    07-26-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Sorting Column of Dates and Quarters

    Never mind, again. All I need to do is insert another column, and if the contents of the prior column contain the string "undetermined," then insert 12/31/2100.

    Thanks for all your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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