简体   繁体   English

如何在Excel单元格中删除字符串的一部分?

[英]How do I remove part of a string in an excel cell?

I have a long list of names (strings) that have extra information in them I don't want in the cell but the extra information is not standard. 我有一长串的名称(字符串),其中包含我不需要的其他信息,但这些信息不是标准的。

How can I remove the extra strings info from these strings? 如何从这些字符串中删除多余的字符串信息?

For example these are a sample of the strings I'm working with: 例如,以下是我正在使用的字符串的示例:

  • Hill, Jeremy CIN RB 希尔(Jeremy CIN RB)
  • Brown, Jaron ARI WR (I) 布朗,Jaron ARI WR(I)
  • Robinson, Denard JAC RB (O) 罗宾逊,丹纳德·杰克·RB(O)
  • Robinson, Denard JAC RB (Q) 鲁滨逊,德纳德·贾克
  • Dixon, Kenneth BAL RB (R) 肯尼思·迪克森BAL RB(R)
  • Janovich, Andy DEN RB (R) (I) Janovich,Andy DEN RB(R)(I)
  • Janovich, Andy DEN RB (R) (O) Janovich,Andy DEN RB(R)(O)
  • Lasco, Daniel NOS RB (R) (Q) 拉斯科,丹尼尔NOS RB(R)(Q)

and I want them all to be just "Last name, First name" 我希望他们都只是“姓氏,名字”

If I use =LEFT(A20,LEN(A20)-7) I won't always get all the extra string, what other formulas can I use? 如果我使用=LEFT(A20,LEN(A20)-7)我将不会总是得到所有多余的字符串,我还可以使用其他哪些公式?

Cheers! 干杯!

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

Try this formula. 试试这个公式。 this formula finds the position of second space in the string and get everything left of it 该公式可找到字符串中第二个空格的位置,并将其剩余的所有内容

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用python在excel单元格中仅加粗字符串的一部分 - How Do I Bold only part of a string in an excel cell with python 如何仅获取Excel或Numbers中单元格的特定部分? - How do I get only a specific part of a cell in Excel or Numbers? 如何在Excel单元格中删除换行符和或Carrige返回字符 - How do I remove Newline and or Carrige return characters in an Excel cell Excel:如何从单元格中删除所有回车? - Excel: how do I remove all carriage returns from a cell? 如何从Excel的单元格中删除某些文本? - How do I remove certain text from a cell in Excel? 如何使用熊猫删除合并的 excel 单元格以进行进一步处理? - How do i remove a merged excel cell with pandas for further processing? 使用Excel进行字符串操作 - 如果有其他部分,如何删除部分字符串? - String manipulation with Excel - how to remove part of a string if another part is there? 如何将一个单元格中的一部分字符串替换为另一单元格中的字符串? - How do I replace part of a string from one cell from a string in another cell? 你如何将excel细胞的一部分分成另一个细胞? - How do you split part of an excel cell into another cell? 如何将 Excel 单元格的内容设置为等于字符串变量? - How do I set the contents of an Excel cell equal to a string variable?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM