# How do I sort a word list by length using Excel or some free utility?

**URL:** <https://boards.straightdope.com/t/how-do-i-sort-a-word-list-by-length-using-excel-or-some-free-utility/150300>\
**Category:** Factual Questions\
**Created:** [January 22, 2003, 10:12pm UTC](https://boards.straightdope.com/t/how-do-i-sort-a-word-list-by-length-using-excel-or-some-free-utility/150300 "2003-01-22T22:12:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Opus1](https://avatars.discourse-cdn.com/v4/letter/o/858c86/32.png) [@Opus1](https://boards.straightdope.com/u/Opus1)\
**Post date:** [January 22, 2003, 10:12pm UTC](https://boards.straightdope.com/t/how-do-i-sort-a-word-list-by-length-using-excel-or-some-free-utility/150300/1 "2003-01-22T22:12:56Z")

</div>

I have a list of words in alphabetical order. E.g.:

APPLE  
BE  
CAT  
DOG  
HIPPOPOTAMUS  
IN

I want to resort it so that it’s sorted by length first, then alphabetically. E.g.:

BE  
IN  
CAT  
DOG  
APPLE  
HIPPOPOTAMUS

Can I do this using Excel or some other utility that either came with Windows XP or that I can get for free on the Internet (and is easy to use!)?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![JeffB](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/jeffb/32/188_2.png) [@JeffB](https://boards.straightdope.com/u/JeffB)\
**Post date:** [January 22, 2003, 10:19pm UTC](https://boards.straightdope.com/t/how-do-i-sort-a-word-list-by-length-using-excel-or-some-free-utility/150300/2 "2003-01-22T22:19:43Z")

</div>

In Excel, you can create a column with the length of the words and sort by that column. For example, if your words are in column A starting in row 1 (‘Apple’ in cell A1), enter the following formula in cell B1:

=len(a1)

That will return 5 for ‘Apple’, 2 for ‘Be’, etc. Copy that formula down the column for the list, and do your sort.

---

<div class="post-metadata">

**Author:** ![Opus1](https://avatars.discourse-cdn.com/v4/letter/o/858c86/32.png) [@Opus1](https://boards.straightdope.com/u/Opus1)\
**Post date:** [January 23, 2003, 1:58am UTC](https://boards.straightdope.com/t/how-do-i-sort-a-word-list-by-length-using-excel-or-some-free-utility/150300/3 "2003-01-23T01:58:09Z")

</div>

Worked like a charm. Thanks.
