根据括号位置从字符串中提取单词

时间:2022-09-13 09:22:48

How do I extract the a word from a string only till the second occurrence of a closing bracket in excel

如何从字符串中提取单词,直到excel中第二次出现结束括号

Eg . Asus K55VD-SX313D Laptop (2nd Gen Ci3/ 4GB/ 500GB/ DOS/ 2GB Graph) (Passion Red)2 Write reviews and it will be helpful it creating value for other readers (hint)

例如。华硕K55VD-SX313D笔记本电脑(第二代Ci3 / 4GB / 500GB / DOS / 2GB图形)(激情红)2写评论,它将有助于它为其他读者创造价值(提示)

How do I extract only this Asus K55VD-SX313D Laptop (2nd Gen Ci3/ 4GB/ 500GB/ DOS/ 2GB Graph) (Passion Red)

如何仅提取此华硕K55VD-SX313D笔记本电脑(第二代Ci3 / 4GB / 500GB / DOS / 2GB图表)(激情红)

2 个解决方案

#1


2  

You can use a LEFT like this:

您可以使用这样的LEFT:

=LEFT(A1,FIND(CHAR(1),SUBSTITUTE(A1,")",CHAR(1),2)))

The innermost function is SUBSTITUTE:

最里面的函数是SUBSTITUTE:

SUBSTITUTE(A1,")",CHAR(1),2)

This substitutes the 2nd occurrence of ) to CHAR(1) (some weird character you can see if you do =CHAR(1) in excel)

这将第二次出现替换为CHAR(1)(如果在excel中执行= CHAR(1),则可以看到一些奇怪的字符)

Next FIND(CHAR(1),SUBSTITUTE(A1,")",CHAR(1),2)) finds position of this character we just substituted into the substituted text.

Next FIND(CHAR(1),SUBSTITUTE(A1,“)”,CHAR(1),2))找到我们刚刚替换为替换文本的该字符的位置。

And LEFT returns all the characters up to this position.

并且LEFT将所有字符返回到此位置。

If you know that your strings can't contain, for example @, you can use this instead of CHAR(1).

如果您知道您的字符串不能包含,例如@,则可以使用它而不是CHAR(1)。

#2


0  

Maybe you can try this:

也许你可以试试这个:

=LEFT(A1,FIND(")",a1,FIND(")",A1)+1))

I'm just looking to find the first ")"... after the first one

我只想在第一个之后找到第一个“)”

#1


2  

You can use a LEFT like this:

您可以使用这样的LEFT:

=LEFT(A1,FIND(CHAR(1),SUBSTITUTE(A1,")",CHAR(1),2)))

The innermost function is SUBSTITUTE:

最里面的函数是SUBSTITUTE:

SUBSTITUTE(A1,")",CHAR(1),2)

This substitutes the 2nd occurrence of ) to CHAR(1) (some weird character you can see if you do =CHAR(1) in excel)

这将第二次出现替换为CHAR(1)(如果在excel中执行= CHAR(1),则可以看到一些奇怪的字符)

Next FIND(CHAR(1),SUBSTITUTE(A1,")",CHAR(1),2)) finds position of this character we just substituted into the substituted text.

Next FIND(CHAR(1),SUBSTITUTE(A1,“)”,CHAR(1),2))找到我们刚刚替换为替换文本的该字符的位置。

And LEFT returns all the characters up to this position.

并且LEFT将所有字符返回到此位置。

If you know that your strings can't contain, for example @, you can use this instead of CHAR(1).

如果您知道您的字符串不能包含,例如@,则可以使用它而不是CHAR(1)。

#2


0  

Maybe you can try this:

也许你可以试试这个:

=LEFT(A1,FIND(")",a1,FIND(")",A1)+1))

I'm just looking to find the first ")"... after the first one

我只想在第一个之后找到第一个“)”