Extract the last substring from a cell

后端 未结 9 1870
逝去的感伤
逝去的感伤 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:21

    Try this:

    =RIGHT(TRIM(A2),LEN(TRIM(A2))-FIND(" ",TRIM(A2)))
    

    I was able to copy/paste the formula and it worked fine.

    Here is a list of Excel text functions (which worked in May 2011, and but is subject to being broken the next time Microsoft changes their website). :-(

    You can use a multiple-stage-nested IF() functions to handle middle names or initials, titles, etc. if you expect them. Excel formulas do not support looping, so there are some limits to what you can do.

提交回复
热议问题