+ Reply to Thread
Results 1 to 4 of 4

Sort by group

  1. #1
    Registered User
    Join Date
    07-06-2005
    Posts
    2

    Sort by group

    In my table, I have a column with dates and a second one with events. The table is sort by events, then by dates.

    Now, I would like to know if there is a possibility to make a third sort in "chunks". In other words, it would sort the groups by the first date of each group of events.

    Thanks

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    You might want to try using this Pivot Table approach:

    Assumptions are that the data is sorted by group, then by date.
    This example is for a list in Cells A1:B100, A1 and B1 contain column headings Event and Date, respectively

    Add a column to the right of the table (col C) and label it StartDate
    Run this formula in C2 and copy it down:
    =VLOOKUP(A28,$A$2:$B$100,2,1)

    Then:
    Select the table range, A1:C100

    Data>Pivot Table
    -Excel List.....[Next]
    -Range is already selected.....[Next]
    -[Layout]:
    ----->ROW: StartDate, Event, Date
    ----->DATA: Date

    Double-Click StartDate and select Advanced, Sort Ascending
    Double-Click Date (in the DATA section) and select COUNT

    Select the Pivot Table location......[Finish]

    That will generate a grouped list of events sorted by the events with the earliest starting dates.

    Does that help?

    Ron

  3. #3
    Registered User
    Join Date
    07-06-2005
    Posts
    2
    Thanks Ron for that procedure.

    I recreated your example, but Excel tells me there is an error in the first formula : =VLOOKUP(A28,$A$2:$B$100,2,1)

    Any idea?

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    Formula typo
    =VLOOKUP(A28,$A$2:$B$100,2,1)

    should be
    =VLOOKUP(A2,$A$2:$B$100,2,1)

    (either my fingers are too big or the keyboard is too small, or both)

    Regards,
    Ron

+ 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