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.

**Step 1**

We have the data in column A as shown below, Enter the formula **=LEN(A1) in cell B2**.

**Step 2**

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.

**Step 3**

Now we will have to sort the data based on their length, to do that go to Sort Option in Data tab in Excel.

**Step 4**

Sort by Length column which we have just calculated and press OK

**Step 5**

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.