Remove last name formula in excel

Copper Contributor

Hello,

 

I have column with some names like below I need formula to remove the last name only from them

 

John Smith

john Abraham smith

john john smith Abraham

 

I tried many formulas but the issue if it two names only it gives me value#

2 Replies

@HUSSIENASCANT 

Let's say you have names in A2 and down.

In B2:

=IFERROR(TEXTJOIN(" ", TRUE, DROP(TEXTSPLIT(A2, " "), , -1)), A2)

Fill down.

@HansVogelaar  Thanks it works perfectly