Log in  \/ 
x
or
x
x
Register  \/ 
x

or

Kutools for Excel 22.00 HOT

300+ Powerful Features You Must Have in Excel

Kutools-for-Excel

Kutools for Excel is a powerful add-in that frees you from performing time-consuming operations in Excel, such as combine sheets quickly, merge cells without losing data, paste to only visible cells, count cells by color and so on. 300+ powerful features / functions for Excel 2019, 2016, 2013, 2010, 2007 or Office 365!

Read More Download Buy now

Office Tab 14.00HOT

Adding Tabbed Interface for Office

Office Tab

It enables tabbed browsing, editing, and managing of Microsoft Office applications. You can open multiple documents / files in a single tabbed window, such as using the browser IE 8/9/10, Firefox, and Google Chrome. It's compatible with Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365. Demo

Read More Download Buy now

Kutools for Outlook 13.00NEW

100+ Powerful Features for Outlook

Kutools-for-Outlook

Kutools for Outlook is a powerful add-in that frees you from time-consuming operations which majority of Outlook users has to perform daily! It can save your time from using Microsoft Outlook 2019, 2016, 2013, 2010 or Office 365!

Read More Download Buy now

Kutools for Word  9.00NEW

100+ Powerful Features for Word

Kutools-for-Word

Kutools for Word is a powerful add-in that frees you from time-consuming operations which majority of Word users have to perform daily! It can save your time from using Microsoft Word / Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365!

Read More Download Buy now

Classic Menu for Office

Bringing Back Your Familiar Menus

Restores the old look and menus of Office 2003 to Microsoft Office 2019, 2016, 2013, 2010, 2007 or Office 365. Don’t lose time in finding commands on the new Ribbon. Easy to deploy to all computers in enterprises and organizations.

Read More Download Buy now

How to sort numbers with text/letter prefix or suffix in Excel?

For example you have a series of numbers containing letter prefix or suffix, how could you sort them as normal numbers in Excel? This article collects several workarounds to get it done.


Sort numbers with text/letter prefix or suffix by user defined function

This method will introduce a user defined function (VBA) to extract numbers only from the numbers with prefix or suffix, and then you can sort easily.

1. Press Alt + F11 keys simultaneously to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and then paste below VBA code into the new opening Module window.

User Defined Function: Extract numbers only from text strings

Function num(rng As Range) As String
Dim n As Integer
For n = 1 To Len(rng)
If Mid(rng, n, 1) Like "[0-9]" Then
num = num & Mid(rng, n, 1)
End If
Next n
End Function

3. Save the code and close the Microsoft Visual Basic for Applications window.

4. Select a blank cell beside original numbers with prefix or suffix, says Cell B2, type the formula =num(A2) (A2 is the number with prefix or suffix) into it, and then drag this cell’s AutoFill Handle to the range as you need.

5. Due to extracted numbers stored as text, we need to convert them to numbers. Copy all extracted numbers, right click copied range and select Paste Values from the right clicking menu. See screenshot:

Note: In Excel 2007, you can copy the extracted numbers stored as text, and then click Home > Paste > Paste Values.

6. Keep selecting these numbers, and then click  button beside selected numbers, and select the Convert to Number from the drop down list. See screenshot:

7. Keep the new numbers selected, and click Data > Sort Smallest to Largest or Sort Largest to Smallest; and then check the Expand the selection option in the popping up Sort Warning dialog box, and click the Sort button. See screenshots:

8. Now the numbers with letter prefix or suffix have been sorted as normal numbers sorting (See below screenshot). Please delete the extracted numbers if necessary.


Sort numbers with text/letter prefix or suffix by extracting numbers

Actually, Kutools for Excel also provides similar EXTRACTNUMBERS function to extract numbers from text strings. Therefore, we can sort numbers with letter prefix or suffix by extracting numbers firstly.

Kutools for Excel - Includes more than 300 handy tools for Excel. Full feature free trial 30-day, no credit card required! Free Trial Now!

1. Select a blank cell beside the numbers with letter prefix or suffix, says Cell B2, type the formula =EXTRACTNUMBERS(A2,TRUE) (A2 is the cell of number with letter prefix or suffix) into it, and then drag this cell’s AutoFill Handle to the range as you need. See screenshot:

2. Keep extracted numbers selected, click Data > Sort Smallest to Largest or Sort Largest to Smallest; check the Expand the selection option in the popping up Sort Warning dialog box, and then click the Sort button. See below screenshots:

3. Now numbers with letter prefix or suffix have been sorted as normal numbers sorting. And you can delete all extracted numbers as you need.


Sort numbers with text/letter prefix or suffix by splitting text and numbers

Kutools for Excel also supports to split text and numbers from cells by its Split Cells utility. Therefore, we can split the text and numbers and place them into different columns for easily sorting. Please do as follows:

Kutools for Excel - Includes more than 300 handy tools for Excel. Full feature free trial 30-day, no credit card required! Free Trial Now!

1. Select the numbers with letter prefix or suffix, and click Kutools > Text > Split Cells. See below screenshot:

2. In the opening Split Cells dialog box, please check the Split to Columns option in the Type section, check the Text and number in the Split by section, and click the Ok button. See above screenshot:

3. Now the second Split Cells dialog box comes out. Please select the cell beside original numbers with letter prefix or suffix, says Cell B2, and click the OK button.
 

Now the texts and numbers are split and placed beside original numbers with prefix or suffix. See below screenshot.

4. Select the split numbers, and click Data > Sort Smallest to Largest or Sort Largest to Smallest; and then check the Expand the selection option in the popping up Sort Warning dialog box, and click the Sort button. See below screenshots:

5. Now the numbers with letter prefix or suffix have been sorted as normal numbers sorting. You can delete the split text and numbers as you need.


Sort numbers with text/letter prefix or suffix by removing letters

This method will introduce Kutools for Excel’s Remove Characters utility to remove all non-numeric characters (including letter) and leave numbers only in cells. And then you can sort numbers with text / letter prefix or suffix easily.

Kutools for Excel - Includes more than 300 handy tools for Excel. Full feature free trial 30-day, no credit card required! Free Trial Now!

1. Copy all numbers with letter prefix or suffix, and then paste beside original numbers with letter prefix or suffix.

2. Keep selecting the pasted numbers, click Kutools > Text > Remove Characters, and then only check the Non-numeric option in the popping up Remove Characters dialog box, and click the Ok button. See below screenshot:

3. Now only numbers are left in the new column. Keep selecting these numbers, and click Data > Sort Smallest to Largest or Sort Largest to Smallest; and then check the Expand the selection option in the popping up Sort Warning dialog box, and click the Sort button. See below screenshots:

4. Delete the numbers as you need.


Demo: sort numbers with text/letter prefix or suffix in Excel


Kutools for Excel includes more than 300 handy tools for Excel, free to try without limitation in 30 days. Download and Free Trial Now!

Articles


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.

Feature Tutorials