• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 51
  • Last Modified:

Formula Help Needed

I have a long string of text in an Excel cell and would like to extract only the last few characters after the last "\".  For example:

C:\subfolder\subfolder\subfolder\subfolder\subfolder\subfolder\spfile.xls

I know there is a way to do it but I can't remember how.

Any help you could give me would be greatly appreciated.

Thanks,
Infosec36
0
Sonia Bowditch
Asked:
Sonia Bowditch
  • 2
1 Solution
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Are you trying to extract the file name?
If so, please give this a try....
Assuming your string is in A2, then
=TRIM(RIGHT(SUBSTITUTE(A2,"\",REPT(" ",LEN(A2))),LEN(A2)))

Open in new window

0
 
Sonia BowditchInformation Security OfficerAuthor Commented:
Perfect.  It does exactly what I needed.
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Sonia! Glad it worked as desired.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now