+ Reply to Thread
Results 1 to 5 of 5

Sorting help needed

Hybrid View

jilaba Sorting help needed 02-04-2017, 05:12 AM
Kaper Re: Sorting help needed 02-04-2017, 05:32 AM
jilaba Re: Sorting help needed 02-04-2017, 05:58 AM
samba_ravi Re: Sorting help needed 02-04-2017, 05:57 AM
jilaba Re: Sorting help needed 02-04-2017, 06:45 AM
  1. #1
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Sorting help needed

    Ref. Attached DroughtPrint

    Column A has survey numbers and i want to sort them in ascending order from 1-1a, 1-1b, 2-2a............... like that. But unable to do so. for example the out put is 250, 349, 1-4, 1-5. In some instances 113-10, then comes 113-4.

    Pls help.
    Attached Files Attached Files
    Ask me how to hate XL.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Sorting help needed

    You shall split your "numbers" into groups/subgroups/.... then sort on several keys, so for instance
    343-8d2a
    or
    53-19-a

    shall be seen as:
    D | E | F | G | H
    343 | 8 | d | 2 | a
    53 | 19 | a

    or may be you see the latter as
    53 | 19 | | | a
    to emphasize it a format 53-19x-NNNa with letter x being empty and number NNN empty too

    Unfortunately, because there are diferent styles (see above with small letters or dash or mixed) it will not be easy to do it automatically

    BTW: isn't the latter (data from row 529) a mistake? it is the only one with a second dash in description.
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Sorting help needed

    Quote Originally Posted by Kaper View Post
    You shall split your "numbers" into groups/subgroups/.... then sort on several keys, so for instance
    343-8d2a
    or
    53-19-a

    shall be seen as:
    D | E | F | G | H
    343 | 8 | d | 2 | a
    53 | 19 | a

    or may be you see the latter as
    53 | 19 | | | a
    to emphasize it a format 53-19x-NNNa with letter x being empty and number NNN empty too

    Unfortunately, because there are diferent styles (see above with small letters or dash or mixed) it will not be easy to do it automatically

    BTW: isn't the latter (data from row 529) a mistake? it is the only one with a second dash in description.
    I thought this will be easy to do. Anyway, is there any other formula / function / application to do this?

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Sorting help needed

    Create helper column d
    d2=text(left(substitute(a2,"-",rept(" ",10)),10),"0000")&iferror("-"&if(len(lookup(10^10,left(mid(substitute(a2,"-",rept(" ",10)),10,15),{1,2,3,4,5,6})+0))=1,0,""),"")&trim(mid(substitute(a2,"-",rept(" ",10)),10,15))
    =text(left(substitute(a2,"-",rept(" ",10)),10),"0000")&iferror("-"&if(len(lookup(10^10,left(mid(substitute(a2,"-",rept(" ",10)),10,15),{1,2,3,4,5,6})+0))=1,0,""),"")&trim(mid(substitute(a2,"-",rept(" ",10)),10,15))
    try this and copy to the end
    now sort data based on column d
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Sorting help needed

    Quote Originally Posted by nflsales View Post
    Create helper column d
    d2=text(left(substitute(a2,"-",rept(" ",10)),10),"0000")&iferror("-"&if(len(lookup(10^10,left(mid(substitute(a2,"-",rept(" ",10)),10,15),{1,2,3,4,5,6})+0))=1,0,""),"")&trim(mid(substitute(a2,"-",rept(" ",10)),10,15))
    =text(left(substitute(a2,"-",rept(" ",10)),10),"0000")&iferror("-"&if(len(lookup(10^10,left(mid(substitute(a2,"-",rept(" ",10)),10,15),{1,2,3,4,5,6})+0))=1,0,""),"")&trim(mid(substitute(a2,"-",rept(" ",10)),10,15))
    try this and copy to the end
    now sort data based on column d
    Yes. It did. Its a great solution for me. Thanks a lot Siva.

+ 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. Help needed in data sorting !!!!
    By gary620 in forum Excel General
    Replies: 3
    Last Post: 11-06-2014, 02:06 AM
  2. Sorting help needed
    By NS4Excel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-27-2014, 05:34 PM
  3. Complex Filter/Sorting Help Needed (VBA knowledge needed)
    By dfxryanjr in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-03-2013, 01:39 PM
  4. Sorting a column by age, formula help needed...
    By amster in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-26-2013, 03:59 PM
  5. [SOLVED] VBA sorting by multiple criteria help needed
    By motorhead9999 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-14-2012, 07:24 PM
  6. Sorting help needed!
    By BrettOlbrys in forum Excel General
    Replies: 7
    Last Post: 12-30-2005, 08:00 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