如何使用Excel公式获取单元格中的最后一个单词 [英] How to get last word in a cell using Excel Formula
问题描述
我正在尝试获取单元格中的最后一个单词,但似乎并没有出现获取该单元格中的最后一个单词.似乎得到了部分匹配,并且无法正常工作.我正在使用=IFERROR(RIGHT(AP2,SEARCH(" ",AP2)-1),AP2)
.即使第一个单词是单元格中的唯一单词,这也非常适合获取单元格中的第一个单词.关于为什么这不能正确地说出最后一句话的任何想法吗?
I am trying to get the last word in a cell however, it does not seem to be appearing getting the last word of the cell. It seems to get the partial match and not working correctly. I am using =IFERROR(RIGHT(AP2,SEARCH(" ",AP2)-1),AP2)
. This works great for getting the first word in a cell even where the first word is the only word in a cell. Any ideas on why this is not getting the last word correctly?
推荐答案
据我所知,以下内容对我有用.
As far as I can tell the below worked for me.
=TRIM(RIGHT(SUBSTITUTE(AP40," ",REPT(" ",100)),100))
我只能假设我的另一种方法在获取最后一个单词时不可靠.
I can only assume my other method is unreliable at getting the last word.
这篇关于如何使用Excel公式获取单元格中的最后一个单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!