Excel - Sorting Data in Excel: Extracting and Sorting by Middle Digits Tutorial - Episode 519
683 views · Published 1 September 2009 · 2:25 · Indexed 20 September 2026
Channel: MrExcel.com · 2009 · Education
Microsoft Excel Tutorial: Sorting Data in Excel: Extracting and Sorting by Middle Digits Tutorial.
Welcome back to the MrExcel netcast! In today's episode, we have a question from George about sorting data in Excel. If you have a question for the netcast, don't hesitate to send me an email or leave a voicemail and we'll try to feature it in a future podcast.
George's data set is a bit tricky - he has a serial number in column A that is formatted as four digits, a space, another four digits, a space, and then seven digits at the end. However, he needs to be able to sort by the middle set of digits. My solution to this is to insert a temporary column, extract the middle digits, sort by that column, and then delete it.
To do this, we first need to insert a column between A and B. Then, we use the MID function to grab the middle digits. We start by typing "=MID(" and then select the cell in A2. We then need to specify which position we want to start in - in this case, it's the sixth position since we have four digits and a space before the middle set. Finally, we specify how many characters we want to grab - in this case, it's four. We can then copy this formula down using the fill handle and we now have a new column with just the middle portion of the serial numbers.
After sorting by this new column, we can delete it and our data is now sorted correctly. The MID function is just one of many useful text functions in Excel, including LEFT and RIGHT which can be used to grab the leftmost or rightmost characters in a string. Thanks to George for sending in this question and don't forget to send in your own questions for a chance to be featured in a future netcast.
Thanks for tuning in to this episode of the MrExcel netcast. Don't forget to subscribe to our channel for more helpful Excel tips and tricks. See you next time!
Buy Bill Jelen's latest Excel book: https://www.mrexcel.com/products/latest/
You can help my channel by clicking Like or commenting below: https://www.mrexcel.com/like-mrexcel-on-youtube/
Table of Contents:
(00:00) Sorting by middle set of digits
(00:40) Solution using temporary column
(00:50) Inserting a column
(01:00) Using the MID function
(01:26) Copying the formula
(01:36) Sorting the data
(01:47) Other functions for grabbing characters
(01:57) Clicking Like really helps the algorithm
#excel #microsoft #microsoftexcel #exceltutorial #exceltips #exceltricks #excelmvp #freeclass #freecourse #freeclasses #excelclasses #microsoftmvp #walkthrough #evergreen #spreadsheetskills #analytics #analysis #dataanalysis #dataanalytics #mrexcel #spreadsheets #spreadsheet #excelhelp #accounting #tutorial
This video answers these common search terms:
Deleting temporary column after sorting data in Excel
Extracting middle digits from serial numbers in Excel
Extracting middle digits in Excel using MID function
How to use the MID function in Excel
MrExcel netcast tutorial on sorting data by middle digits
Sorting data by specific set of characters in Excel
Sorting data in Excel by middle digits
Sorting data in Excel by specific column
Sorting data in Excel using temporary column
Sorting data using temporary column in Excel
Using the MID function to extract characters in Excel
YouTube video on sorting data by middle set of digits
Join the MrExcel Message Board discussion about this video at https://www.mrexcel.com/board/threads/1152596/
George has a dataset today where a serial number contains 3 groups of digits in a single column. George needs to be able to sort by the middle group of digits. Episode 519 shows you how.
This video is the podcast companion to the book, Learn Excel from MrExcel. Download a new two minute video every workday to learn one of 277 tips from the book!
More from this channel
-
3:57
Excel 2007 - Color of Selected Sheets is too much like unselected sheets - Episode 907
-
2:48
Excel - Adding Equals Icon to Excel QAT - Build Formula with Mouse - Episode 911
-
2:37
Excel - Enhance Your Excel Charts: Add a Picture as a Background in Excel - Episode 917
-
2:00
Excel Hiding Data in Plain Site - Episode 919
-
2:20
Excel - Bring Back The Full Excel 2003 Dialogs In Excel! - Episode 920
-
2:33
Excel - Why Have Three Worksheets In Every New Excel Workbook? Episode 921
-
2:12
Excel - MrExcel Tenth Anniversary Survey - Episode 877.5
-
3:37
Excel - Master the Camera Tool in Excel - Easily Align Numbers with Cartesian Grid - Episode 883