+ Reply to Thread
Results 1 to 8 of 8

sorting cell data based on order of digits

  1. #1
    Registered User
    Join Date
    11-17-2012
    Location
    sri lanka
    MS-Off Ver
    Excel 2010
    Posts
    13

    sorting cell data based on order of digits

    hi all,

    please help me with that sorting data not based on cell value but based on data order as shown in the following example.

    Ex:

    Original Data
    28
    25
    287
    289
    2560
    25620
    2897
    28899
    257
    257000

    Sorted Data
    25
    2560
    25620
    257
    257000
    28
    287
    289
    28899
    2897


    i want to sort the Original Data by comparing digits starting form left to right as show in the example (Sorted Data).

    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: sorting cell data based on order of digits

    here is a messy way, maybe some1 else has a simpler method.

    1. with your data in A2 down, copy this in b2 down =VALUE("."&A2)
    2. copy/paste the results as values
    3. sort the new data
    4. convert those numbers back to the originals using =VALUE(MID(C2,3,10))
    5. copy/paste the results as values

    yes, i said it was messy, sorry
    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
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: sorting cell data based on order of digits

    Assume that your data is in Column-A and the First Row is column Headers.

    In Column-B - First Row name it as Helper. So your data will be starting from 2nd Row

    Copy and paste the below formula in B2 cell
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Drag it down.

    Now select A & B Column Data and use Sort (Alt+D+S) Select Helper in Sort By and in Sort on Values Order A-Z.

    Edit: @FDibbins, Sorry... Not seen your reply at the time of posting, since seriously involved in typing the above text to OP. But after posting it seem to be same method...
    Last edited by :) Sixthsense :); 12-12-2012 at 02:08 AM.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    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: sorting cell data based on order of digits

    @ Six, no problem, been there, done that, got the tshirt and cap lol. and actually, i think i like yours better, it keeps the 257000, mine lost the 000

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: sorting cell data based on order of digits

    @ FDibbins,

    I believe your method is working fine. The POINT #1 of your Post #2 is enough and rest of the points should be ignored.

    The OP should use your Point No1 formula in helper column and use that for sort criteria.

  6. #6
    Registered User
    Join Date
    11-17-2012
    Location
    sri lanka
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: sorting cell data based on order of digits

    Hi,

    yes its works fine and it helped me a lot.

    thanks for the all of your support.

    Roshan

  7. #7
    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: sorting cell data based on order of digits

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  8. #8
    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: sorting cell data based on order of digits

    duplicate post
    Last edited by FDibbins; 12-12-2012 at 09:24 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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