extract a substring between the first and second backslash from the right

Dear Experts:

I would like to extract string between first and second back slash from the RIGHT using a formula (bolded string)

Any idea how I can achieve this? The string to be extracted always starts with PM_

Help is much appreciated. Thank you very much in advance.

Regards, Andreras

\\172.20.10.68\DATEN$\KLS_Allgemein\NEW\Lot2\DMD\PM_4\Sample_File_2_bw.pdf
\\172.20.10.68\DATEN$\KLS_Allgemein\DMD\PM_2_3\Sample_File_4_bw_new_2.pdf
Andreas HermleTeam leaderAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Maybe this...

Assuming your string is in A2, then try this...

=REPLACE(REPLACE(A2,1,FIND("\PM_",A2),""),FIND("\",REPLACE(A2,1,FIND("\PM_",A2),"")),255,"")

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Andreas HermleTeam leaderAuthor Commented:
Hi Neeraj,

great, works like a charm, very professional, I highly appreciate it.

Regards, Andreas
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Andreas! Glad it worked as desired.
Thanks for the feedback.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.