As this is directly regarding the codes in @W_Vann_Hall’s demo base in this thread I’ll ask my question here rather than to start a new topic.
My {WholeName} field follow the format “FirstName MiddleName LastName (neé MaidenName)”.
I want to break it down to four fields
- First name
- Middle name
- Last name
- Maiden name
I can get it to return 1-3 correctly as long as there is no maiden name, if there is it no longer provides the correct last name. No supprise there.
For my purposes I assume it would be best to treat (neé MaidenName) as a suffix and by that logic remove it in {TrimSuffix}.
I tried the following code to strip the MaidenName-part
SUBSTITUTE(
IF(
OR(FIND(" Jr",TrimName)=LEN(TrimName)-3,
FIND(" Sr",TrimName)=LEN(TrimName)-3,
FIND(" II",TrimName)=LEN(TrimName)-3,
FIND(" IV",TrimName)=LEN(TrimName)-3),
LEFT(TrimName,LEN(TrimName)-4),
IF(
OR(FIND(" Jr.",TrimName)=LEN(TrimName)-4,
FIND(" Sr.",TrimName)=LEN(TrimName)-4,
FIND(" III",TrimName)=LEN(TrimName)-4),
LEFT(TrimName,LEN(TrimName)-5),
IF(
FIND("(",TrimName),
LEFT(TrimName, SEARCH("(", TrimName)-1),
TrimName))),",",""
)
It removes the whole maiden name part okay, but now {Last Name} no longer outputs a last name at all where a maiden name is present in {WholeName}. Any and all help to adjust this would be greatly appreciated. If I can achieve a last name here then I can get the fourth field, maiden name, on my own.