In the current version of Excel this is a fairly simple problem using the TEXTAFTER and TEXTBEFORE functions.

Both approaches are explained below.

A positive instance number tells TEXTBEFORE to count from thestartof the text string.

Extracting a middle name in older versions of Excel

A negative instance number tells TEXTBEFORE to count from theend.

Next, we need to calculate the number of characters to extract.

This is a more difficult problem.

Extracting a middle name in older versions of Excel

The formula above will work correctly when there are two spaces in the name.

However, when a second space is not found (i.e.

there is no middle name, FIND will return a #VALUE!

Extracting a middle name in older versions of Excel

For example, =MID(“apple”,2,3) returns “ppl”.

When the text is not found, FIND returns a #VALUE error.

IFERROR is an elegant way to trap and manage errors without using more complicated nested IF statements.

Extracting a middle name in older versions of Excel

How to create a complex formula step by step

Extracting a middle name in older versions of Excel

Excel formula: Get first name from name

Excel formula: Get last name from name

Excel formula: Split full name into parts

Excel formula: Get first name from name with comma

Excel formula: Get last name from name with comma

Excel formula: Join first and last name

Excel TEXTAFTER function

Excel TEXTBEFORE function

Excel MID function

Excel FIND function

Excel IFERROR function

Article image

Extracting a middle name in older versions of Excel