简体   繁体   English

在Excel中最后指定的特殊字符之前删除文本

[英]Remove text before last specified special character in Excel

I've got a list of categories in a breadcrumb trail, and I need to extract the latest category. 我在面包屑路径中有一个类别列表,我需要提取最新类别。

Below is a sample of the list, and I need to get the category after the last /, or if there is no /, then the category. 以下是列表的示例,我需要获取最后一个/之后的类别,或者,如果没有/,则获取该类别。 So the following would turn into the below. 因此,以下内容将变为以下内容。

Before 之前

Sewing
Crafting/Paper & Paper Crafts
Scrapbooking & Stamping
Crafting/Craft Supplies
Painting, Drawing & Art Supplies/Painting/Brushes
Beading & Jewelry Making/Charms
Beading & Jewelry Making/Beading Supplies

After

Sewing
Paper & Paper Crafts
Scrapbooking & Stamping
Craft Supplies
Brushes
Charms
Beading Supplies

Can anyone point me to an excel formula that can do this please? 谁能指出我可以执行此操作的excel公式?

Use the SUBSTITUTE function to create a large gap of spaces at the forward slashes then peel off the right end and use the TRIM function to clean it up. 使用SUBSTITUTE函数在正斜杠处创建一个较大的间隙,然后剥去右端并使用TRIM函数对其进行清理。

=TRIM(RIGHT(SUBSTITUTE(A1, "/", REPT(" ", 999)), 999))

Fill down as necessary. 根据需要填写。

用权利和修剪代替

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

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