+ Reply to Thread
Results 1 to 4 of 4

Sorting dates grouped into bunches of 7 days (i.e. weeks)

  1. #1
    Registered User
    Join Date
    07-24-2012
    Location
    Tangmere, UK
    MS-Off Ver
    Excel 2007
    Posts
    2

    Sorting dates grouped into bunches of 7 days (i.e. weeks)

    An odd one - I've got a load of dates, which have been grouped into groups of 7 to make weeks. When I sort "Oldest to Newest" in the PivotTable, it seems to be sorting them by the first number or two:

    excelproblm.gif

    If it's of any help, these are UK format dates, so dd/mm/yyy, and when I select the cells and go to cell format it looks like this:

    excelproblem2.gif

    Let me know if a spreadsheet attachment would be helpful.

    Many thanks

    Harvey

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Sorting dates grouped into bunches of 7 days (i.e. weeks)

    they are not real excel dates if in the same cell like that they become text and are sorted as text

    you need to extract the first date =LEFT(A1,10)+0 into another column /include that in your pivot then sort by that
    Last edited by martindwilson; 07-26-2012 at 11:36 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-24-2012
    Location
    Tangmere, UK
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Sorting dates grouped into bunches of 7 days (i.e. weeks)

    Ah, I suspected so.

    Grouping into 7's didn't seem like a particularly built-in function.

    Don't suppose you know of a workaround?

    Many thanks for your help.

    Edit: Hmm, I thought about manually removing the second bit (eg. "- 08/01/2012"), but even when in correct date format, it kept the same order :-/
    Last edited by PTMHarvey; 07-26-2012 at 11:45 AM.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Sorting dates grouped into bunches of 7 days (i.e. weeks)

    Edit: Hmm, I thought about manually removing the second bit (eg. "- 08/01/2012"), but even when in correct date format, it kept the same order :-/
    did you not read my last post re =LEFT(A1,10)+0 do that then you can copy paste back over itself then delete column a and use the new values instead

+ 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