+ Reply to Thread
Results 1 to 12 of 12

Custom List for Sort Order - Using Sorted Values w/ Commas

  1. #1
    Registered User
    Join Date
    08-20-2019
    Location
    Chicago, IL
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    5

    Question Custom List for Sort Order - Using Sorted Values w/ Commas

    So, I've got a unique scenario that I can't figure out and doesn't seem to have been solved elsewhere yet.

    Excel allows users to create "Custom List" data for sorting cells - unfortunately, these lists are inherently delimited via commas and it seems to be non-negotiable.

    Ordinarily, it wouldn't cause an issue except that in this case the very list that I'd like to use for Sort Order has several values that are separated by commas...

    Does anybody know how-to prevent Excel from delimiting Custom List values that are listed with commas? (w/o using VBA code)

    Example List:

    C
    C, LW
    C, RW
    C, LW, RW
    LW
    LW, RW
    RW
    D
    G

    I'd appreciate any help on this subject. Thanks!

    Edit: Cross-Posted on MrExcel [mrexcel/forum/excel-questions/1107488-custom-list-sort-order-using-sorted-values-w-commas]
    Last edited by Hawks18; 08-22-2019 at 05:31 PM. Reason: Cross-Post Update

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    08-20-2019
    Location
    Chicago, IL
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    5

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    Basically, I am extracting data from an external sports website that contains player data, including Position Eligibility...that field may contain multiple positions, which are delimited by commas and imported as such into our data.

    So, that raw data is separated into multiple columns - one of which being "Position Eligibility" that retains potentially delimited information. It gets super complex from there...as that table feeds several (15+) other sheets using Power Query and Pivot Tables, which are automatically populated, formatted, and sorted upon refreshing connections.

    I'm trying to avoid manual sorting or maintenance of conversion on a per-query basis, while also retaining congruent formatting as used by our source data. 20+ queries extract data from that original table and should appear seamless relative to the source website.

    C
    LW
    RW
    D
    G

    ^--- All of those entries sort perfectly, but the following entries are ALWAYS sorted last...

    C, LW
    C, RW
    C, LW, RW
    LW, RW

    I've gotta believe there's some way to modify Excel's built-in delimiter for Custom List entries, no?

    ...or at the very list some special character / command to force an exception?
    Attached Files Attached Files

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    I did a find and replace in the column you wish to sort. Replaced the commas with a Pipe (|). In the custom sort order, I created the sort order as shown in Column L. Then sorted. Sort is as you desired. I then highlighted the sorted column and did a find and replace. Finding the Pipe and replacing with a comma. A bit labor intensive, but it does give the expected results.

  5. #5
    Registered User
    Join Date
    08-20-2019
    Location
    Chicago, IL
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    5

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    Alan,

    I appreciate the workaround, but data is already transposed several times before reaching its end point that needs to be sorted correctly.

    I'm really trying to avoid another level of indirection or manual manipulation, as to reduce the effort it already takes to update and maintain this workbook.

    If necessary, I'm able to perform similar steps manually per query, but that process would need to be duplicated 10 times (as 10 different sheets reference and must be sorted by these list options)...it's not really practical to maintain that much redundancy, you know?
    Last edited by AliGW; 08-21-2019 at 05:07 PM. Reason: Please don’t quote unnecessarily!

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    That's the best answer I have for you. Good Luck with your issue.

  7. #7
    Registered User
    Join Date
    08-20-2019
    Location
    Chicago, IL
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    5

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    Quote Originally Posted by alansidman View Post
    That's the best answer I have for you. Good Luck with your issue.
    Thank you, sir!

  8. #8
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    I think there's no direct way to do this.
    If you're ok to use vba, I think I can write a code to do this by using vba & a temporary helper column (without a custom list). And it can do the sort in all sheets in one go if you want.

  9. #9
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    I haven't been able to force custom lists to work, either. VBA could do it. Another alternative that is easy, if mildly tedious, is to use conditional formatting to color your eligible positions according to your list options, then do a sort by color. Create a basic CF rule with a different fill color for each position combo, then create a sort by color with the appropriate order. You can pasteFormating to carry the conditional formatting to the other team sheets, then replicate the sort by color rules. I did the former but not the latter in the attachment - some of the tedium must be yours. It builds character. It should only take a few minutes, though.

    Take a look at Team A in the attachment, see if it'll work for you.

    Let's go Hawks!!
    Attached Files Attached Files
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future


    https://www.mrexcel.com/forum/excel-...-w-commas.html

  11. #11
    Registered User
    Join Date
    08-20-2019
    Location
    Chicago, IL
    MS-Off Ver
    Office Professional Plus 2013
    Posts
    5

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    Quote Originally Posted by alansidman View Post
    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future
    Alan,

    I'd tried to post a link to that Cross-Posted thread, but received an error message stating that I cannot supply links or other content prior to "posting a few times".

    What was I supposed to do in that scenario?

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Custom List for Sort Order - Using Sorted Values w/ Commas

    Just say where else you have cross-posted for now - forum names.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. Replies: 2
    Last Post: 01-03-2017, 08:40 AM
  2. Sort a list with a number of order# and values
    By Legend Rubber in forum Excel General
    Replies: 7
    Last Post: 11-25-2015, 05:32 PM
  3. [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
  4. Pull Unique Values from a List and Automatically Sort in Alphabetical Order
    By Aimee S. in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-29-2013, 09:43 AM
  5. [SOLVED] Extract Unique Values from Long list and Put in Sorted Order
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-08-2013, 09:10 PM
  6. Replies: 3
    Last Post: 09-08-2012, 09:23 AM
  7. Replies: 5
    Last Post: 03-01-2012, 01:56 PM

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