Let's say your maiden names are in column A and your full names (minus the maiden name) are in column B.
First, you'll need to know how many spaces are in your cell so you can insert at the last space. For Mary A. K. Smith,
[tab]=LEN(B1) - LEN(SUBSTITUTE(B1, " ", ""))
will return 3
Now we want to take everything to the left of the last space, add in the maiden name found in column A, and finish up with everything to the right of the last space.
We know there are three spaces, but we need to find where that last space is within the whole cell. In order to find the last space, I'll use Substitute to change the last space to something else - some character(s) that will NEVER appear in the data. Two "pipes" in a row should be safe. The pipe is the shifted character on the key above [Enter] - the same key as the slash (\). The last argument of Substitute is instance_num - we'll use our first formula to return how many spaces there are.
For "Mary A. K. Smith" in column B,
[tab]=SUBSTITUTE(B1, " ", "||", LEN(B1) - LEN(SUBSTITUTE(B1, " ", "")))
will return "Mary A. K.||Smith"
Now we have a string that we can easily divide into first name/initials vs. last name with simple Left/Right formulas.
[tab]=LEFT(B1, FIND("||", SUBSTITUTE(B1, " ", "||", LEN(B1) - LEN(SUBSTITUTE(B1, " ", "")))))
will return "Mary A. K."
Add the maiden name using an &, like this:
[tab]=LEFT(B1, FIND("||", SUBSTITUTE(B1, " ", "||", LEN(B1) - LEN(SUBSTITUTE(B1, " ", ""))))) & A1
to get "Mary A. K. Doe"
and now finish off by getting everything to the right of the ||:
[tab]=RIGHT(B1, LEN(B1) - FIND("||", SUBSTITUTE(B1, " ", "||", LEN(B1) - LEN(SUBSTITUTE(B1, " ", "")))) + 1)
will return " Smith" - the "+1" at the end including the leading space.
Now just tie everything together and you come up with this (admittedly long) formula:
[COLOR=blue white]=LEFT(B1, FIND("||", SUBSTITUTE(B1, " ", "||", LEN(B1) - LEN(SUBSTITUTE(B1, " ", ""))))) & A1 & RIGHT(B1, LEN(B1) - FIND("||", SUBSTITUTE(B1, " ", "||", LEN(B1) - LEN(SUBSTITUTE(B1, " ", "")))) + 1)[/color]
which returns "Mary A. K. Doe Smith"
[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]
Help us help you. Please read FAQ181-2886 before posting.