+ Reply to Thread
Results 1 to 9 of 9

Sorting issue

  1. #1
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    434

    Sorting issue

    Dear all

    I have a problem in sorting the following

    G1 to G40

    When I do sorting , it shows this. It there any way I can solve this ?

    G1
    G10
    G11
    G12
    G13
    G14
    G15
    G16
    G17
    G18
    G19
    G2

    Eric

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,515

    Re: Sorting issue

    You have to include zeros as placeholders to the maximum value you expect to encounter.

    If you do not expect to hit G100, then put a 0 in front of every value under 10 (i.e. G02)
    If you expect to exceed 100 (but not 1000) then you need an additional zero (i.e G002 and G015)
    Does that work for you?
    ChemistB
    My 2

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Expert sandy666's Avatar
    Join Date
    02-05-2015
    Location
    Any Country
    MS-Off Ver
    farerwell
    Posts
    8,749

    Re: Sorting issue

    you can try
    your data is in A1:A12
    in B1: =--MID(Q1,2,LEN(Q1)) and drag down
    select A1:B12
    use SORT from Ribbon by column B (smallest to largest
    after that you can delete helper column B
    Last edited by sandy666; 05-23-2017 at 10:13 AM.
    sandy
    How to create an editor for Power Query with Notepad++ (tutorial)
    How to create timeline project with vertical today marker (2010, 2013, 2016 etc...) (examples)
    Tips for Excellent Spreadsheets

    What makes learning so hard is the amount of knowledge you have to unlearn
    Why is my program not doing what I expect?
    Because you set the wrong expectations. Rewire your brain

  4. #4
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    434

    Re: Sorting issue

    Dear Sandy666 and Chemist

    I tried both method, it shows

    G1
    G10
    G11
    G12
    G13
    G14
    G15
    G16
    G17
    G18
    G19
    G2
    G20
    G21
    G3

  5. #5
    Forum Expert sandy666's Avatar
    Join Date
    02-05-2015
    Location
    Any Country
    MS-Off Ver
    farerwell
    Posts
    8,749

    Re: Sorting issue

    I made mistake
    in B1: =--MID(A1,2,LEN(A1))

    see att. algorithm is the same
    Attached Files Attached Files
    Last edited by sandy666; 05-23-2017 at 05:16 PM.

  6. #6
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    434

    Re: Sorting issue

    Sandy

    This is still not working

  7. #7
    Forum Expert sandy666's Avatar
    Join Date
    02-05-2015
    Location
    Any Country
    MS-Off Ver
    farerwell
    Posts
    8,749

    Re: Sorting issue

    See the movie in zip

    or attach example xlsx file because I don't know what kind of characters you are using, local or something

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,515

    Re: Sorting issue

    Quote Originally Posted by Eric Tsang View Post
    Dear Sandy666 and Chemist

    I tried both method, it shows
    G1
    If you tried my method, it wouldn't be showing G1 or G2 because I said to replace G1 with G01 and G2 with G02.

  9. #9
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Excel 2007 & 2003
    Posts
    2,888

    Re: Sorting issue

    Suppose your data from "A2" to "A13"
    Enter formula in "B2"
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copy down
    then sort with helper column. [column "B" is helper]


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

+ 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 issue
    By sortingitout in forum Excel General
    Replies: 2
    Last Post: 08-04-2016, 07:51 AM
  2. sorting issue
    By kesavanprabhu in forum Excel General
    Replies: 1
    Last Post: 06-14-2014, 05:43 AM
  3. Sorting issue
    By KTed in forum Excel General
    Replies: 1
    Last Post: 09-02-2012, 01:58 PM
  4. sorting issue
    By step_one in forum Excel General
    Replies: 1
    Last Post: 10-12-2011, 06:30 PM
  5. Sorting Issue
    By tdurton in forum Excel General
    Replies: 6
    Last Post: 06-10-2009, 04:04 PM
  6. Sorting issue
    By Wayne Knazek in forum Excel General
    Replies: 5
    Last Post: 10-29-2008, 04:12 PM
  7. sorting issue
    By gfrantsen1961 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-06-2007, 08:33 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