+ Reply to Thread
Results 1 to 16 of 16

Please HELP! Custom Sort List

  1. #1
    Registered User
    Join Date
    06-29-2012
    Location
    Arizona
    MS-Off Ver
    Excel 2010
    Posts
    18

    Please HELP! Custom Sort List

    I am looking to create a custom sort list for my data. The data I wish to sort is below:
    •Text C
    •Text D
    •Text 8
    •Text 1
    •Text M


    I would like to sort the data by having the alpha first and the numeric last (the excel default is numeric first, then alpha) - see below:
    •Text C
    •Text D
    •Text M
    •Text 1
    •Text 8

    I have tried to create a custom list by writing out the alpha then the numeric (A,B,C....Z,0,1,2,...9) but that doesn't seem to change anything.

    Since the word "text" is in each piece of data, I cannot change the format to a "number" format.
    Also, I cannot manipulate original data since it is pulled from another source.

    Please help!

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Please HELP! Custom Sort List

    One way I can think of would be add a helper column. This formula assumes column B contains the Letter/Number

    =IF(ISNUMBER(B1),CODE(B1)+122,IF(ISTEXT(B1),CODE(B1),""))

    And sort by the helper column

    Unless the word Text is also in each cell?
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  3. #3
    Registered User
    Join Date
    06-29-2012
    Location
    Arizona
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Please HELP! Custom Sort List

    Yes the word "text" is in each cell. I'm pulling the data from a source that places numeric last. I would like to have excel sort the same way so when I print the lists, they match up with each other.

    I don't understand why my custom list isn't working in the first place.

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Please HELP! Custom Sort List

    This might do the trick...

    Add this in a new column and sort by it

    =IFERROR(CODE(TRIM(MID(B1,FIND(" ",B1),LEN(B1)-(FIND(" ",B1)-1)))+0)+122,CODE(TEXT(TRIM(MID(B1,FIND(" ",B1),LEN(B1)-(FIND(" ",B1)-1))),"0")))

    Edit: Just realized, this won't work for double-digit or double-letter entries.... 11 will sort as 1, and AB will sort as A

    Last edited by Speshul; 07-29-2014 at 02:24 PM.

  5. #5
    Registered User
    Join Date
    06-29-2012
    Location
    Arizona
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Please HELP! Custom Sort List

    I seem to be stumped. It seems you are trying to turn the text into a number which we can sort by number.

    Is there another way to rewrite the custom sort list so it will sort the way I want it to?

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Please HELP! Custom Sort List

    Enter this in a helper column next to your values and copy down then select all the data (your data and helper column) and Sort and Filter, Custom Sort and sort on the helper column smallest to largest.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    A
    B
    C
    1
    2
    •Text C
    67
    =IF(ISNUMBER(RIGHT(A2,1)*1),CODE(RIGHT(A2,1))+100,CODE(RIGHT(A2,1)))
    3
    •Text D
    68
    4
    •Text M
    77
    5
    •Text 1
    149
    6
    •Text 8
    156
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  7. #7
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Please HELP! Custom Sort List

    Quote Originally Posted by Jwildcat View Post
    I seem to be stumped. It seems you are trying to turn the text into a number which we can sort by number.

    Is there another way to rewrite the custom sort list so it will sort the way I want it to?

    What my formula did is strip the "Text " part away, to be left only with letters or numbers, then to determine the character code of that letter or number

    Where A = 65 by default, B = 66. But 1 = 49, 2 = 50, so if it was a number and not a letter, I am adding 122 (which is the code for lowercase "z") to the characters code value, to make sure letters are always LOWER code values than numbers

    Resulting in 1 = 171, 2 = 172, and so on, while
    A = 65, B = 66

    So they will sort by Letters, then Numbers

    Looks like newdoverman also came up with a similar angle of attack, looks like it has the same disadvantage as mine though, multiple digits won't sort


    I don't really have any experience with the custom sort lists unfortunately, I'm sure someone will be by though!
    Last edited by Speshul; 07-29-2014 at 02:56 PM.

  8. #8
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Please HELP! Custom Sort List

    You could use this part of my formula though, to strip the numbers or letters out of the cell into a helper column, and try and sort by it?

    =TRIM(MID(B1,FIND(" ",B1),LEN(B1)-(FIND(" ",B1)-1)))

  9. #9
    Registered User
    Join Date
    06-29-2012
    Location
    Arizona
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Please HELP! Custom Sort List

    Quote Originally Posted by Speshul View Post
    You could use this part of my formula though, to strip the numbers or letters out of the cell into a helper column, and try and sort by it?

    =TRIM(MID(B1,FIND(" ",B1),LEN(B1)-(FIND(" ",B1)-1)))
    This seems to be close. This removes "trims" the first word out of my data. Is there a way to remove 2 words?

  10. #10
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Please HELP! Custom Sort List

    How many variations of words are there before the character to sort by?

    Or, is it always two words? Is there a special character at the end before the number? (for example, "This is the data: 2")

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Please HELP! Custom Sort List

    This should take care of the number problem: If there is a possibility of lower case letters then change the 100 to 200.

    A
    B
    C
    1
    2
    •Text A
    65
    =IF(ISNUMBER(RIGHT(A2,1)*1),MID(A2,SEARCH(" ",A2),5)*1+100,CODE(RIGHT(A2,1)))
    3
    •Text C
    67
    4
    •Text D
    68
    5
    •Text M
    77
    6
    •Text 1
    101
    7
    •Text 152
    252
    8
    •Text 810
    910
    9
    •Text 8001
    8101
    Last edited by newdoverman; 07-29-2014 at 03:51 PM.

  12. #12
    Registered User
    Join Date
    06-29-2012
    Location
    Arizona
    MS-Off Ver
    Excel 2010
    Posts
    18

    Question Re: Please HELP! Custom Sort List

    So it seems that my actual data is different than my "test data" Here is the data below. Thank you to newdoverman for the help! I'm super stumped.
    The items in red are the ones that will need to come AFTER their flavored counterparts.

    VODKA ABSOLUT 80 12/LTR
    VODKA ABSOLUT ACAI BERRY 12/LTR
    VODKA ABSOLUT CITRON 80 12/LTR
    VODKA BELVEDERE 80 1/LTR
    VODKA BELVEDERE GRAPEFRUIT 6/750ML
    VODKA CHOPIN 6/LTR
    VODKA GREY GOOSE 6/LTR
    VODKA GREY GOOSE CHERRY NOIR 6/1LTR
    VODKA GREY GOOSE CITRON 6/LTR
    VODKA HANGER ONE 12/LTR
    VODKA HANGER ONE CHIPOTLE 12/LTR
    VODKA HANGER ONE CITRON BUDDHAS 12/LTR


    I would like it to look like this below:
    VODKA ABSOLUT ACAI BERRY 12/LTR
    VODKA ABSOLUT CITRON 80 12/LTR
    VODKA ABSOLUT 80 12/LTR

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Please HELP! Custom Sort List

    This seems to work with the example given but I hope someone can shorten this "beast". Enter this in a helper column beside the data and copy down. Select the original data AND the helper column and sort on the helper column.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by newdoverman; 07-29-2014 at 06:44 PM.

  14. #14
    Registered User
    Join Date
    06-29-2012
    Location
    Arizona
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Please HELP! Custom Sort List

    I am working with microsoft support who gave me the idea of performing a text to column this would isolate the portion I want to sort

    I could then sort first by Column B
    ABSOLUT
    ABSOLUT
    ABSOLUT
    ABSOLUT
    BELVEDERE
    BELVEDERE
    CHOPIN

    Then column C
    80
    ACAI
    CITRON
    GRAPEVINE
    80
    GRAPEFRUIT
    6/LTR

    I still have an issue of the numbers coming first but I believe it is easier without the text preceding it. Any advice on this problem?

  15. #15
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Please HELP! Custom Sort List

    scrape this idea...becoming too behemoth of a formula
    look at next post
    Last edited by humdingaling; 07-30-2014 at 01:19 AM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  16. #16
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Please HELP! Custom Sort List

    actually enhancing newdovers solution
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    VODKA HANGER ONE 12/LTR becomes VODKA HANGER ONE Z...bring it down the bottom
    Last edited by humdingaling; 07-30-2014 at 01:17 AM. Reason: forgot the zzz

+ 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. [SOLVED] custom list does not sort
    By Matt Lunn in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 04:05 AM
  2. Excel sort by Fill Color by custom list sort
    By Dash4Cash in forum Excel General
    Replies: 2
    Last Post: 07-29-2005, 06:05 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