简体   繁体   English

Excel-删除序列中字符前的所有文本

[英]Excel - Remove All Text Before A Character In Sequence

I have cells that contain text in this format: 我的单元格包含以下格式的文本:

Category 1>Category 2>Category 3>Category 4
Category 1>Category 2
Category 1>Category 2>Category 3
Category 1

...and so on. ...等等。 I would like to run a formula that removes all before the last entry in the sequence. 我想运行一个公式,该公式删除序列中最后一个条目之前的所有内容。 So the above would output as: 因此,以上内容将输出为:

Category 4
Category 2
Category 3
Category 1

I've tried using this formula but it obviously removes only the text before the first delimiter in the sequence: 我试过使用此公式,但显然它只删除序列中第一个定界符之前的文本:

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

How do I adapt the formula to achieve what I want to do? 如何调整公式以实现自己想要的目标? Cheers. 干杯。

You may use 您可以使用

=TRIM(RIGHT(SUBSTITUTE(A2,">",REPT(" ",LEN(A2))),LEN(A2)))

Drag/Copy down as required. 根据需要向下拖动/复制。

在此处输入图片说明

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM