View Single Post
 
Old 02-09-2016, 03:35 PM
BudVitoff BudVitoff is offline Windows 7 64bit Office 2007
Advanced Beginner
 
Join Date: Sep 2011
Posts: 52
BudVitoff is on a distinguished road
Default

Hey, I even got comfortable with the ISERROR!

To extract the middle name, work with the string in the full name starting after the 1st space, and try to deliver the number of bytes in the middle name: (position of 2nd space) - (position of 1st space) - 1. If this fails because there is no 2nd space, deliver a 0. This number becomes the third parameter of the MID function.

=MID(A16,FIND(" ",A16)+1,IFERROR((FIND(" ",A16,(FIND(" ",A16)+1))) - (FIND(" ",A16))-1,0))

To extract just the middle initial, look for a second space. If it's there, deliver the first letter of the middle name; otherwise deliver a null.

=IF(ISERROR(FIND(" ",A16,(FIND(" ",A16)+1))),"",(MID(A16,FIND(" ",A16)+1,1)))

Are we having fun yet?

Last edited by BudVitoff; 02-09-2016 at 09:39 PM.
Reply With Quote