In this article we will see how we could sort by length in excel i.e.We may have some data arranged in a column and we want the longest string to appear first and then the string shorter than the first and so on length of the strings gradually decreases.
We will see a simple way in excel to sort the text strings based on the number of character they have.
Below is the data which is sorted based on their lengths.
We have the data in column A as shown below, Enter the formula =LEN(A1) in cell B2.
Enter the length formula to calculate the number of characters in the string on the basis of which we will sort by length and drag it till you have the data available in column A.
Now we will have to sort the data based on their length, to do that go to Sort Option in Data tab in Excel.
Sort by Length column which we have just calculated and press OK
As you could see below the data is sorted in descending order of their lengths, to sort the data in ascending order just select the order “Smallest to largest” in the Sort box in Step 4.
Now you could delete or hide the length column based on your requirement.
Hope this helped.