Aug 07 2023 06:59 PM
Hello. This is my first post on here so bear with me.
I have a workbook with full name cells that have first and last name data that are formatted as follows: "Mickey De La Ratones (nickname)" without the quotes. I'm trying to create a last name cell with a formula that parses out all the words of a last name from one of these full name cells (regardless of how many words are in the last name) and skips over the first name. I think there is something that can be done with using an open parentheses as the delimiter for when to stop, I just don't know how to do this. Anyone have some ideas on formula(s) that can accomplish this?
Thank you all in advance.
Aug 07 2023 08:58 PM
You could try Flash Fill. But you have to provide several examples to get the AI to recognize the pattern.
But you will never get a 100% solution.
Aug 07 2023 11:30 PM
Aug 08 2023 02:29 AM
Are names like
Alexandre Manuel de la Vega Martíne (nickname)
i.e. last name is between "de la" and "(" ?
Aug 08 2023 09:24 PM
@peiyezhu "De La Ratones" without the quotes is the result I am trying to get.
Aug 08 2023 09:39 PM
Aug 09 2023 01:47 AM
@nmnick89 If your version of Excel supports TEXTAFTER, then try this for a full name in cell A1:
=LET( everything_after_first_name, TEXTAFTER(TRIM(A1)," "),
position_of_open_paren, IFERROR( FIND("(",everything_after_first_name), LEN(everything_after_first_name)+1 ),
without_nickname, TRIM( LEFT(everything_after_first_name, position_of_open_paren-1) ),
without_nickname)
You can use shorter names than I created, but using explanatory names is a good practice. The first TRIM function is not required, but prevents problems with any leading space(s) that might appear in the data. The IFERROR function handles the case where no open parenthesis is found (and presumably no nickname is present).
Aug 09 2023 09:11 AM
If not 365, same as @SnowMan55 sample gives
=TRIM( MID( A1,
FIND(" ", A1),
IFERROR(FIND("(", A1), LEN(A1)) - FIND(" ", A1)
) )
Aug 14 2023 07:09 AM
Thanks, please share your feedback if any of answers works with you.
Aug 14 2023 04:32 PM