+ Reply to Thread
Results 1 to 6 of 6

How to sort lines in order of number of letters

  1. #1
    Registered User
    Join Date
    07-26-2010
    Location
    bucharest
    MS-Off Ver
    Excel 2003
    Posts
    12

    Question How to sort lines in order of number of letters

    I want to sort a lot of lines (about 50k) from a notepad in order of how many letters contain each line.

    At the end I want my lines to look like

    x
    xx
    xxx
    xxxx
    xxxxx
    xxxxxx
    xxxxxxx

    and so on

    Can someone explain me how to do this ?

    thank you
    Last edited by wizi; 09-06-2011 at 04:31 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: How to sort lines in order of number of letters

    Add one more column, use =LEN(A1) and sort by that column
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    07-26-2010
    Location
    bucharest
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: How to sort lines in order of number of letters

    thank you
    I used that code in and I got in B column the number of characters of each line from the first column.
    Now I have something like: 26,43,32,41,33,19,7 etc

    But how do I order them to get an ascending column like: 5,6,8,12,19,24 etc

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: How to sort lines in order of number of letters

    Add header column and in that column add Filter (Data -> Filter).

    then sort by it.

    Or select some cell in B column, Select all and right click -> Sort

  5. #5
    Forum Contributor
    Join Date
    08-01-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2007
    Posts
    182

    Re: How to sort lines in order of number of letters

    You need to sort that column using the sort function.
    Select both the columns
    Go to sort
    Then select "Sort by Column B"

  6. #6
    Registered User
    Join Date
    07-26-2010
    Location
    bucharest
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: How to sort lines in order of number of letters

    thank you. it worked

+ 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