How to sort a list of words by character-count?

If I have a list of words: computer, salt, candy, etc., is there a way to sort the words by character count – from shortest to longest word. I have Access, Excel, Word… Will any of these programs do it?

You could do it manually using EXCEL.
• In column A type your word list with one word in each row
• In colum B type this formula in each row "=len(An)" (without the quotes. n is the row number)
The len function returns the number of characters in a text string
• Select all your data (colummn A: word listColummn B: number of characters)
• Sort your data: From the menu bar select DATA and from the dropdown list select sort, This will open the sort window
• In the sort window, indicate how to sort your data. Example
Sort by Colummn B ascending (means sort by character count)
then by column A ascending (means if more than one element has the same amount of characters then sort alphabetic)
Depending if you have include the heading row or not, under "My data range has" select "Header row" or "No header Row"

Hope this help.

2 Responses to “How to sort a list of words by character-count?”

  1. Jim Says:

    You will have to write a visual basic macro and use the String$() function to count the number of characters in each word.
    References :

  2. gospieler Says:

    You could do it manually using EXCEL.
    • In column A type your word list with one word in each row
    • In colum B type this formula in each row "=len(An)" (without the quotes. n is the row number)
    The len function returns the number of characters in a text string
    • Select all your data (colummn A: word listColummn B: number of characters)
    • Sort your data: From the menu bar select DATA and from the dropdown list select sort, This will open the sort window
    • In the sort window, indicate how to sort your data. Example
    Sort by Colummn B ascending (means sort by character count)
    then by column A ascending (means if more than one element has the same amount of characters then sort alphabetic)
    Depending if you have include the heading row or not, under "My data range has" select "Header row" or "No header Row"

    Hope this help.
    References :

Leave a Reply