View Single Post
 
Old 02-06-2016, 11:11 AM
dpic44's Avatar
dpic44 dpic44 is offline Mac OS X Office for Mac 2011
Novice
 
Join Date: Feb 2016
Posts: 8
dpic44 is on a distinguished road
Default

Hi BudVitoff, Pecoflyer and xor!

In the middle initial, I see that if the first FIND causes an error then the result is null, if no error, the formula then looks at the two MID's. The +1 gets rid of the space before and the -1 gets rid of the space after, correct? And I see the -1 in the formula for the first name, which gets rid of the space between the first name and middle initial.

For the last name, I thought a RIGHT function was needed. Finding the length makes sense to me, but I'm not grasping the use of the two MID"s.

Can you explain it using if then else?

FIRST NAME:
=LEFT(A18,FIND(" ",A18)-1)

MIDDLE INITIAL:
=IF(ISERROR(FIND(" ",A18,1+FIND(" ",A18))),"",MID(A18,FIND(" ",A18)+1,FIND(" ",A18,1+FIND(" ",A18))-FIND(" ",A18)-1))

LAST NAME:
=IF(ISERR(FIND(" ",A18,1+FIND(" ",A18))),MID(A18,FIND(" ",A18)+1,LEN(A18)),MID(A18,1+FIND(" ",A18,1+FIND(" ",A18)),LEN(A18))

I broke down the formula for the last name and got the results below, which work if there is a middle initial. If there is no middle initial I get an error with all three. So I know all three parts work together, just not understanding the syntax.

Jeffrey R. Evers --> =(FIND(" ",A22,1+FIND(" ",A22))) -->result is 11, counts back from last name
Jeffrey R. Evers --> =MID(A23,FIND(" ",A23)+1,LEN(A23)) -->result is R. Evers
Jeffrey R. Evers --> =MID(A21,1+FIND(" ",A21,1+FIND(" ",A21)),LEN(A21)) -->result is Evers

Thank you again! I really appreciate your help.

Last edited by dpic44; 02-06-2016 at 11:50 AM. Reason: Adding information
Reply With Quote