Extract the last substring from a cell

后端 未结 9 1874
逝去的感伤
逝去的感伤 2020-12-01 07:57

I have names in a column. I need to split just the last names from that column into another column.

The last name is delimited by a space from the right side.

9条回答
  •  生来不讨喜
    2020-12-01 08:31

    Simpler would be: =TRIM(RIGHT(SUBSTITUTE(TRIM(A2)," ",REPT(" ",99)),99))

    You can use A2 in place of TRIM(A2) if you are sure that your data doesn't contain any unwanted spaces.

    Based on concept explained by Rick Rothstein: http://www.excelfox.com/forum/showthread.php/333-Get-Field-from-Delimited-Text-String

    Sorry for being necroposter!

提交回复
热议问题