K20GH
K20GH

Reputation: 6263

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?

Upvotes: 0

Views: 58

Answers (1)

user4039065
user4039065

Reputation:

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.

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

Fill down as necessary.

        SUBSTITUTE with RIGHT and TRIM

Upvotes: 1

Related Questions