Excel函数可以从其他单元格中获取第一个单词

时间:2021-09-06 22:18:03

Excel: What function can I use to take the all the characters from the beginning to the first '<". I am trying to strip out the first word from A1 and put it into B1

Excel:我可以用什么函数把所有的字符从开始到第一个“<”。我想把第一个词从A1中去掉,放到B1中

Eg:

例如:

A1
Toronto<b> is nice

I want "Toronto" in the next cell.

下一个单元格是“多伦多”。

Ian

伊恩

5 个解决方案

#1


34  

How about something like

如何像

=LEFT(A1,SEARCH(" ",A1)-1)

or

=LEFT(A1,SEARCH("<b>",A1)-1)

Have a look at MS Excel: Search Function and Excel 2007 LEFT Function

看看MS Excel:搜索功能和Excel 2007左侧功能

#2


9  

If you want to cater to 1-word cell, use this... based upon astander's

如果你想迎合一个词的细胞,使用这个…基于astander的

=IFERROR(LEFT(A1,SEARCH(" ",A1)-1),A1)

#3


1  

I found this on exceljet.net and works for me:

我在exceljet.net上发现了这个,并为我工作:

=LEFT(B4,FIND(" ",B4)-1)

#4


0  

A1                   A2 
Toronto<b> is nice   =LEFT(A1,(FIND("<",A1,1)-1))

Not sure if the syntax is correct but the forumla in A2 will work for you,

不确定语法是否正确,但是A2中的forumla会为你工作,

#5


-1  

Generic solution extracting the first "n" words of refcell string into a new string of "x" number of characters

通用解决方案将refcell字符串的第一个“n”字提取为一个新的字符串“x”字符数。

=LEFT(SUBSTITUTE(***refcell***&" "," ",REPT(" ",***x***),***n***),***x***)

Assuming A1 has text string to extract, the 1st word extracted to a 15 character result

假设A1有文本字符串提取,第一个字提取到15个字符结果。

=LEFT(SUBSTITUTE(A1&" "," ",REPT(" ",15),1),15)

This would result in "Toronto" being returned to a 15 character string. 1st 2 words extracted to a 30 character result

这将导致“Toronto”被返回到一个15个字符串。前2个单词提取到30个字符的结果

=LEFT(SUBSTITUTE(A1&" "," ",REPT(" ",30),2),30)

would result in "Toronto is" being returned to a 30 character string

“多伦多”会被退回到30个字符串吗?

#1


34  

How about something like

如何像

=LEFT(A1,SEARCH(" ",A1)-1)

or

=LEFT(A1,SEARCH("<b>",A1)-1)

Have a look at MS Excel: Search Function and Excel 2007 LEFT Function

看看MS Excel:搜索功能和Excel 2007左侧功能

#2


9  

If you want to cater to 1-word cell, use this... based upon astander's

如果你想迎合一个词的细胞,使用这个…基于astander的

=IFERROR(LEFT(A1,SEARCH(" ",A1)-1),A1)

#3


1  

I found this on exceljet.net and works for me:

我在exceljet.net上发现了这个,并为我工作:

=LEFT(B4,FIND(" ",B4)-1)

#4


0  

A1                   A2 
Toronto<b> is nice   =LEFT(A1,(FIND("<",A1,1)-1))

Not sure if the syntax is correct but the forumla in A2 will work for you,

不确定语法是否正确,但是A2中的forumla会为你工作,

#5


-1  

Generic solution extracting the first "n" words of refcell string into a new string of "x" number of characters

通用解决方案将refcell字符串的第一个“n”字提取为一个新的字符串“x”字符数。

=LEFT(SUBSTITUTE(***refcell***&" "," ",REPT(" ",***x***),***n***),***x***)

Assuming A1 has text string to extract, the 1st word extracted to a 15 character result

假设A1有文本字符串提取,第一个字提取到15个字符结果。

=LEFT(SUBSTITUTE(A1&" "," ",REPT(" ",15),1),15)

This would result in "Toronto" being returned to a 15 character string. 1st 2 words extracted to a 30 character result

这将导致“Toronto”被返回到一个15个字符串。前2个单词提取到30个字符的结果

=LEFT(SUBSTITUTE(A1&" "," ",REPT(" ",30),2),30)

would result in "Toronto is" being returned to a 30 character string

“多伦多”会被退回到30个字符串吗?