+ Reply to Thread
Results 1 to 4 of 4

Custom Sort Order - Series Data

  1. #1
    Registered User
    Join Date
    05-24-2016
    Location
    Buffalo, NY
    MS-Off Ver
    Mac 2016
    Posts
    3

    Custom Sort Order - Series Data

    I have looked online everywhere for this answer - I feel like it's very simple, and perhaps I'm just not searching the right terms.

    I have a 4 column spreadsheet of events.

    Column A = Title
    Column B = Start Date
    Column C = End Date
    Column D = Location

    Each Location has 6 events going on at any given time. I need to sort Column D in a specific order by Location - but not the way Excel would typically do it with a Custom List.

    I do NOT want:

    Location A
    Location A
    Location A
    Location B
    Location B
    Location B
    Location C
    Location C
    Location C

    I DO want to sort this column (and its associated other columns for a given row) to have this order:

    Location A
    Location B
    Location C
    Location A
    Location B
    Location C
    Location A
    Location B
    Location C

    Is this possible?

    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
    52,933

    Re: Custom Sort Order - Series Data

    Hi, welcome to the forum :0

    I added a helper column () to assist with this...
    A
    B
    2
    Location A
    1
    3
    Location B
    1
    4
    Location C
    1
    5
    Location A
    2
    6
    Location B
    2
    7
    Location C
    2
    8
    Location A
    3
    9
    Location B
    3
    10
    Location C
    3

    B2=COUNTIF($A$2:A2,A2)
    copied down.

    then sort based on the helper column
    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
    Registered User
    Join Date
    05-24-2016
    Location
    Buffalo, NY
    MS-Off Ver
    Mac 2016
    Posts
    3

    Re: Custom Sort Order - Series Data

    Thanks for the quick reply! Unfortunately, this doesn't work 100% and it may just be because I'm not explaining it correctly.

    Assigning a helper column in this way will group the locations together, but doesn't always put them in the same order (how would Excel know the proper order if all 3 have the same value? This appears to only group them, but not sort them within that group).

    Maybe a real life example is the only way to go -

    Here is the current spreadsheet: http://thinkforwardstudios.com/wp-co...ay-flavors.csv

    In Column D, you can see there are 6 values repeated throughout the column. I need them to be in the same, albiet repeated, order. It doesn't matter which Location comes first, just that they are in a consistent order.

    For example, the spreadsheet should sort the data aligned as follows (order not important, but the consistency of the given order is important, FYI):

    Sheridan Drive
    Main Street
    Union Road
    Niagara Falls Boulevard
    Transit Road
    Delaware Avenue
    Sheridan Drive
    Main Street
    Union Road
    Niagara Falls Boulevard
    Transit Road
    Delaware Avenue
    Sheridan Drive
    Main Street
    Union Road
    Niagara Falls Boulevard
    Transit Road
    Delaware Avenue
    Sheridan Drive
    Main Street
    Union Road
    Niagara Falls Boulevard
    Transit Road
    Delaware Avenue
    Sheridan Drive
    Main Street
    Union Road
    Niagara Falls Boulevard
    Transit Road
    Delaware Avenue
    Sheridan Drive
    Main Street
    Union Road
    Niagara Falls Boulevard
    Transit Road
    Delaware Avenue

    As you can see, all 6 locations are represented and the block of 6 locations has the same repeating order. This is what I'm looking for. Now, because there are also dates associated and those also need to be in order, I thought a simple sort by date and then by location would work, but it does not.

    I have 6 simultaneous all-day "flavors" going on, one at each location, and I'd like the data to have all of the first set of dates together, in order, along with location - location being the more important (consistent) factor. In other words, because some dates may not line up 100%, the location should always line up.

    Are you following me?

    Thanks again!

  4. #4
    Registered User
    Join Date
    05-24-2016
    Location
    Buffalo, NY
    MS-Off Ver
    Mac 2016
    Posts
    3

    Re: Custom Sort Order - Series Data

    Nevermind, that actually did it for me! Thanks so much!

+ 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. VBA Sort Custom Order
    By tandchas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2016, 02:37 PM
  2. How to custom sort order?
    By onohong in forum Excel General
    Replies: 0
    Last Post: 08-11-2015, 11:57 PM
  3. Sort Column by Custom Order
    By nKife in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-05-2015, 08:52 PM
  4. [SOLVED] custom sort list order in vba
    By sarksloane in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-20-2014, 09:45 AM
  5. Custom sort order
    By 4lowie in forum Excel General
    Replies: 14
    Last Post: 03-09-2014, 11:08 AM
  6. VBA Custom Sort Order Issues
    By Warderbrad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2012, 04:38 PM
  7. Problems with custom sort order
    By bluphoto in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-11-2008, 06:23 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