+ Reply to Thread
Results 1 to 9 of 9

sorting in specific order

  1. #1
    Registered User
    Join Date
    04-21-2015
    Location
    HK
    MS-Off Ver
    2007
    Posts
    40

    sorting in specific order

    hi guys,

    i have a lots of data in the same column,

    and i wanna sort them in specific order

    for example

    A
    A12
    B
    B23
    C
    D
    E
    F12
    G
    H
    I
    J1234


    and the expected sorting order is :

    D
    E
    F
    F12
    A
    A12
    ......

    in specifically, i have dynamic numbers behind the text.. may be added one day, and i cant set up a sorting just by adding the custom sorting in excel.
    Any thoughts on this sorting?

    Happy Weekend!
    Last edited by nth34; 06-01-2015 at 09:44 PM.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,362

    Re: sorting in specific order

    Perhaps something like this?
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-21-2015
    Location
    HK
    MS-Off Ver
    2007
    Posts
    40

    Re: sorting in specific order

    my case is i have specific ranking order... not ascending or descending... thats the most difficult part for me...
    for example..
    a
    b
    c
    d
    e
    f

    my sorting order may be like
    f
    a
    b
    c
    d

    and sometimes

    f
    f12
    aa12
    a1234
    c
    d23
    d345

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,964

    Re: sorting in specific order

    Since this appears to be TOTALLY random, can you please post some REAL examples (before and after) so that we can discern what patterns (if any) are present - and also preferably in an Excel sheet?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,964

    Re: sorting in specific order

    One way, based on your first post's "examples", might be the use of a helper column and a lookup table..
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 05-30-2015 at 01:01 PM. Reason: my poor English (inexcusable for a native speaker!!)

  6. #6
    Registered User
    Join Date
    04-21-2015
    Location
    HK
    MS-Off Ver
    2007
    Posts
    40

    Re: sorting in specific order

    Sorry for the misunderstanding..
    I should list much more details.
    Sorry guys,

    I have a list of data that have to follow the rank.
    For example.

    LIST:
    Daddy
    Mum
    Child
    Pet

    And my data in random:
    A
    B
    Child
    Pet
    Mum
    Dad

    And my expected result is
    Daddy
    Mum
    Child
    Pet
    A
    B

    But the most inconvenience part is:
    daddy123
    daddy456
    mum990
    mum
    child
    child1

    and the numbers after text would be dynamic.
    and i dont know how to sort them accordingly.
    as in vba, i can specific the ranking of each "daddy""mum""child", but once there are dynamic numbers behind the text, i dont want to amend the code for each time..
    for a few dozens of data are fine, how about thousands, millions, lol

    i cant amend the code each time.
    Is there any possible solution to handle this kind of condition?

    Best Wishes,
    Matt

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,964

    Re: sorting in specific order

    I have a sinking feeling about this when I see:

    daddy123
    daddy456
    mum990
    mum
    child
    child1

    Two cases (Daddy and child) where the numbers are in ascending order and one (mummy) where the opposite is true. If that's a mistake: take a look at the sheet. Otherwise, I think you're going to HAVE to explain what's REALLY going on and show us some REAL data and the logic behind the sort order.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-21-2015
    Location
    HK
    MS-Off Ver
    2007
    Posts
    40

    Re: sorting in specific order

    Quote Originally Posted by Glenn Kennedy View Post
    I have a sinking feeling about this when I see:

    daddy123
    daddy456
    mum990
    mum
    child
    child1

    Two cases (Daddy and child) where the numbers are in ascending order and one (mummy) where the opposite is true. If that's a mistake: take a look at the sheet. Otherwise, I think you're going to HAVE to explain what's REALLY going on and show us some REAL data and the logic behind the sort order.
    Sorry bro, its my mistake.
    you are right!thank you so much for the solution.
    Its quite indirect in excel.

    Thank you so much!

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,964

    Re: sorting in specific order

    You're welcome and thanks for the Reputation...

+ 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. Sorting a range to invert it upside down without sorting by any specific column
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2013, 12:53 PM
  2. [SOLVED] Sorting a range to invert it upside down without sorting by any specific column
    By luv2glyd in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2013, 12:43 PM
  3. Calculate subtotals based on specific criteria + put in specific order
    By msls09 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2013, 12:47 AM
  4. print specific worksheets in specific order.
    By jarvo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2006, 06:10 AM
  5. sorting in order
    By ceemo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-30-2005, 08:20 AM

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