

For more details, see How to sort and keep rows together. In the dialog box that pops up, choose the Expand the selection option and click Sort. With the numbers selected, go to the Home tab > Sort & Filter > Sort Smallest to Largest. Sort the original data by the extracted numbers.

To quickly extract numbers from any position in a cell, you can use the Extract tool included with our Ultimate Suite for Excel. Additionally, the *1 operation is performed to convert the text output to number: In older Excel versions, the same result can be achieved using a combination of three different functions that extract text after a specific character. As with any other Text function, its output is always text, regardless of whether you are retrieving letters or digits, so we multiply the result by 1 to convert a text string to a number. In Excel 365, this can be done using the TEXTAFTER function. In this example, we can simply extract all the characters after a hyphen ("-"). In a column next to the original values, enter a formula that extracts number from string.This will let you keep the original data unchanged but rearrange it the way you like. To prevent Excel from handling numbers in alphanumeric strings as text, we're going to extract those numbers in a helper column, and sort by that column. And here's the result we are trying to achieve. To sort a column of numbers containing a letter prefix or suffix as numbers, carry out the steps below. With the built-in Excel Sort feature, alphanumeric strings (combined text and numbers) are always sorted as text, i.e. How to sort mixed numbers and text in Excel The result will be like in column A in the previous screenshot. On the contrary, if you wish to sort numbers as text, convert numbers to text first, and then click Home tab > Editing group > Sort & Filter > Sort A - Z. The result is in column C in the screenshot below. If the target column contains numbers formatted as text, all it takes for the numbers to sort normally is to convert text to number. That happens when numbers are actually text and they sort as text - like words that are arranged based on their letters, "text-numbers" are sorted based on their digits instead of their values. You may sometimes get something like this: When sorting a column of numbers from smallest to largest in Excel, instead of having this:
