Sort Names by Middle Name in Excel

This post will guide you how to sort full name by middle name in excel 2013, or 2016. How do I sort names by middle name with excel formula. How to sort full names by middle name using Text to Columns command in excel.

Sort Names by Middle Name using Excel Formula

Assuming that you have a list of names in your worksheet and you would like to alphabetize by middle name. You can create an excel formula based on the IF function, the ISERR function, the FIND function, and the MID function.

You need to extract the middle name firstly, then you can use the sort command to sort the middle names.  So we need to create a formula to get the middle name from the full name.

Let’s see the following example to sort full names in range B2:B4 by middle name.

1# you can write down the following formula to get middle name:

=IF(ISERR(FIND(“ “,B2, FIND(“ “,B2)+1))),” “, MID(B2, FIND(“ “,B2)+1, FIND(“ “,B2, FIND(“ “,B2)+1))-FIND(“ “, B2)-1))

Or you can use the following formula to get middle name:

= MID(B2,FIND(" ",B2)+1,FIND("#",SUBSTITUTE(B2," ","#",2),1)- FIND(" ",B2,1)-1)

sort names by middle name 1

If you want to know how this formula works, you can refer to this post: How to get First name, Middle name and Last name.

2# select the cells that contain middle name in range C1:D4, and then click “DATA”-> Sort A to Z.

sort names by middle name2

3# select “Expand the selection” radio button. Then click “Sort” button. You will see that the full names have been sorted by middle names.

sort names by middle name3

Sort Names by Middle Name using Text to Columns command

You can also use the Text to Columns command to extract the middle name from a full name in excel. Then you can sort the full name by middle name cell. Just refer to the following steps:

1# Select the range of cells that contains full name, then click on Data -> Text to Columns (under Data Tools group)

sort names by middle name4

2# the “Convert Text to Columns Wizard” windows will appear. Then select Delimited radio button. Click “Next” button.

sort names by middle name5

3# select Space option in Delimiters section box, then click “Next” button.

sort names by middle name6

4# choose Destination Cell, such as: C1, then click “Finish” button.

sort names by middle name7

5# you will see that all full names have been split into three columns.

sort names by middle name9

6# select cells that contain middle name, then click Data-> Sort A to Z command, choose “Expand the selection” radio button, then click “sort” button.

sort names by middle name10


Related Posts

  • Split full name to first and last name
    You can create another formula based on the RIGHT function, the LEN function, the FIND function and the SUBSTITUTE function to extract the last name……
  • Sort Name by Last Name in Excel
    Assuming that you have a list of names in your worksheet and you would like to alphabetize by last name. You can create an excel formula based on the RIGHT function, the LEN function, the FIND function and the SUBSTITUTE function.
  • Get first word from text string
    If you want to extract the first word from a text string in a cell, you can use a combination of the IF function, the ISERR function, the LEFT function and the FIND function to create a complex excel formula..…
  • Get last word from text string
    If you want to get the last word from a text string, you can create an excel formula based on the RIGHT function, the LEN function, the FIND function and the SUBSTITUTE function..…
  • Extract nth word from text string
    If you want to extract the nth word from a text string in a single cell, you can create an excel formula based on the TRIM function, the MID function, the SUBSTITUTE function, the REPT function and the LEN function..…

Related Functions

  • Excel IF function
    The Excel IF function perform a logical test to return one value if the condition is TRUE and return another value if the condition is FALSE. The IF function is a build-in function in Microsoft Excel and it is categorized as a Logical Function.The syntax of the IF function is as below:= IF (condition, [true_value], [false_value])….
  • Excel ISERR function
    The Excel ISERR function returns TRUE if the value is any error value except #N/A.The syntax of the ISERR function is as below:= ISERR (value)…
  • Excel FIND function
    The Excel FIND function returns the position of the first text string (sub string) within another text string.The syntax of the FIND function is as below:= FIND(find_text, within_text,[start_num])…
  • Excel Substitute function
    The Excel SUBSTITUTE function replaces a new text string for an old text string in a text string.The syntax of the SUBSTITUTE function is as below:= SUBSTITUTE  (text, old_text, new_text,[instance_num])….
  • Excel MID function
    The Excel MID function returns a substring from a text string at the position that you specify.The syntax of the MID function is as below:= MID (text, start_num, num_chars)….

 

Related Posts
How to Remove All Asterisk Characters from Cells in Excel
How to Remove All Asterisk Characters7

Sometimes when we opening an excel spreadsheet to check data, we may notice that there are some asterisks exist in texts for security or other reasons. If you feel these special characters are invalid you can remove them from cells. ...

How to Convert Date Format from Dot MM.DD.YYYY to Slash MM/DD/YYYY in Excel
Convert Date Format from Dot to Slash 6

We often enter dates in excel tables, and we can enter current date by quickly press ‘Ctrl+;’ simultaneously. If in some cases we enter a date format that is not what we want, we have to switch the date format ...

How to Remove Quotes for Text or Strings in Excel
How to Remove Quotes 8

When we importing data from other source into Excel we may import quotes or quotations from initial file. And we want to remove these quotes from current file, if we remove them one by one it needs a lot of ...

How to Remove Specific Character from Text Cell in Excel
remove specific character from text string6

This post will guide you how to remove a specific character from text cell in Excel. How do I remove certain character from a cell with a formula in Excel 2013/2016. Remove Specific Character Using Find and Replace function Remove ...

How to Count Comma Separated Value in One Cell in Excel
count value separated by comma2

This post will guide you how to count values in a single cell separated by commas with a formula in Excel. How do I count comma separated values in one cell in Excel 2013/2016. Is it possible to have a ...

How to Count the Number of Letters or Numbers separately in a Cell in Excel
count number of letters3

This post will guide you how to count the number of a given character in a cell in Excel. How do I count only numbers within a single cell excluding all letters and other characters with a formula in Excel. ...

How to Remove the First/Last Word from Text string in Cell
remove first last word in cell2

This post will guide you how to remove the first and the last word from a text string in cells in Excel. How do I use a formula to remove first and last word of a text string in Excel. ...

How to Remove Line Breaks (Carriage Returns) in Excel
remove line breaks9

This post will explain that how to remove line breaks in your data set in Excel. How do I remove carriage returns or line breaks with a formula in Excel. How to remove line breaks with VBA Macro in Excel. ...

How to Convert DD-MM-YYYY text string or date to a standard date format in Excel
convert ddmmyyy test to date format1

This post will guide you how to convert dd-mm-yyyy test string or a date to a standard date format mm/dd/yyyy with a formula in Excel. Convert Text DD-MM-YYYY to Date Format Video: Convert DD-MM-YYYYY to Standard Date Format Convert Text ...

How to convert Column Letter to Number in Excel
convert column letter to number8

This post will guide you how to convert column letter to number in Excel. How do I convert letter to number with a formula in Excel. How to convert column letter to number with VBA macro in Excel. How to ...

Sidebar