+ Reply to Thread
Results 1 to 5 of 5

Sorting date ranges

  1. #1
    Registered User
    Join Date
    12-07-2010
    Location
    Exeter, England
    MS-Off Ver
    Excel 2003
    Posts
    12

    Sorting date ranges

    I am new to this site and am hoping you can help me with an excel sorting issue. I have extracted a load of data into excel and it comes through in the following format:

    Row Labels
    01/08/2010 - 07/08/2010
    02/05/2010 - 08/05/2010
    03/10/2010 - 09/10/2010
    04/07/2010 - 10/07/2010

    I would like it to be sorted by the actual date of the first Range as at the moment it is sorting by the number so 01,02,03 but it should be by the first date. Does that make sense? I can find no way of sorting like this so any help you can provide would be great.

    Kind regards,

    Chris

  2. #2
    Registered User
    Join Date
    12-04-2008
    Location
    Birmingham, UK
    MS-Off Ver
    Office 2007
    Posts
    43

    Re: Sorting date ranges

    I am sure there is a more sophisticated method than mine but here is what I would do. I think your data is not formatted as dates. So:

    Insert two columns next to your data. In the first column extract your first date using the left function. In your second column extract the second date using the right function.

    Then format the new cells as date and you should be able to sort.

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Sorting date ranges

    Following up on dcaracher's suggestion, you can also extract the dates using text to columns - delimited and using "-" as delimiter. No functions necessary in this case

  4. #4
    Registered User
    Join Date
    12-07-2010
    Location
    Maidenhead
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sorting date ranges

    The reason this is happening is that if the entire text "01/08/2010 - 07/08/2010" is in one cell, then that can't be recognised as a date. What you can do is.....
    Insert a second Column next to and left of the "01/08/2010 - 07/08/2010" cells.
    Copy the same "01/08/2010 - 07/08/2010" into the adjacent new column.
    Paint all cells in the original Column
    Use the "Find&Select" tool and go to "Replace"
    In "Find What" enter "-*" the star AFTER the - is very important.
    In "Replace With" DON'T enter anything
    Click "Replace All"
    Do the same for the new adjacent column but removing all characters BEFORE the "-"
    Use the "Find&Select" tool and go to "Replace"
    In "Find What" enter "*-" the star BEFORE the - is very important.
    In "Replace With" DON'T enter anything
    Click "Replace All"
    Then paint both Column A&B and replace the remaining "-" character with a space.
    Use the "Find&Select" tool and go to "Replace"
    In "Find What" enter "-" the dash only.
    In "Replace With" DON'T enter anything
    Click "Replace All"
    Then use AppleBits.com to remove all leading and trailing spaces from all cells - which should leave you with two columns with date format data in.
    Then format the columns and sort on column A as you see fit.
    Last edited by MPanter; 12-07-2010 at 09:50 AM.

  5. #5
    Registered User
    Join Date
    12-07-2010
    Location
    Exeter, England
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Sorting date ranges

    Thats great! Thanks both.

+ 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