Extract string right to left until second repeated special character

UserI

New Member
Joined
Mar 16, 2022
Messages
24
Office Version
  1. 365
Platform
  1. Windows
Hi,
I need to clean the information from a column to result the string after the second > from the right. Examples below.

Data: Promotion > Promotion > Promotion > Performance
Result: Promotion > Performance

Data: Transfer > Transfer > Transfer > Career progression
Result: Transfer > Career progression

Data: Request compensation change > Compensation change > Market Adjustment
Result: Compensation change > Market adjustment

Hope you can help me.
Thanks a lot!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I think this might work for you. It counts the number of ">" in your cell (e.g. A1), and then replaces the count-1 instance with a caret (^). It then finds that character and adds two (assumes there is a space after the ">" before the text string starts) and retrieves the rest of the text to the right.
Excel Formula:
=MID(SUBSTITUTE(A1,">","^",LEN(A1)-LEN(SUBSTITUTE(A1,">",""))-1),FIND("^",SUBSTITUTE(A1,">","^",LEN(A1)-LEN(SUBSTITUTE(A1,">",""))-1))+2,LEN(A1))
 
Upvote 0
Solution
I think this might work for you. It counts the number of ">" in your cell (e.g. A1), and then replaces the count-1 instance with a caret (^). It then finds that character and adds two (assumes there is a space after the ">" before the text string starts) and retrieves the rest of the text to the right.
Excel Formula:
=MID(SUBSTITUTE(A1,">","^",LEN(A1)-LEN(SUBSTITUTE(A1,">",""))-1),FIND("^",SUBSTITUTE(A1,">","^",LEN(A1)-LEN(SUBSTITUTE(A1,">",""))-1))+2,LEN(A1))
Thank you so much! It works and it's really really helpful. 🙂
 
Upvote 0
Wow, that is much easier. Someday I'll actually look into the new functions. They may come in handy. :)
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,913
Members
448,532
Latest member
9Kimo3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top