righttoleft text searching
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel Training and help » RIght-to-left text searching

RIght-to-left text searching

resolvedResolved · Low Priority · Version 2007

replyReply Fri 4 Nov 2011, 12:22Delegate Lisa said...

Lisa has attended:
Excel Advanced course

RIght-to-left text searching

Is there any way to make Excel search a text string from right to left, rather than left to right?

I have a series of file paths (eg G:\My Documents\Lisa\document.doc) where the path lengths and file names are different lengths and I would like to extract the file name (eg document.doc).

Ideally, I would use some combination of =RIGHT and =FIND to tell it pull the text after it has found '\' by searching right to left but I don't see how to do this.

Any thoughts appreciated.

Cheers,
Lisa

For upcoming training course dates see: Pricing & availability

replyReply Fri 4 Nov 2011, 15:41Delegate Lisa said...

RE: RIght-to-left text searching

I'm still curious as to the answer, but I have found a workaround. For anyone interesed, I knew the file names were all around 6/7 folders deep so I did a kind of nested find function with some iferrors to cover a variety of folder lengths. Not the prettiest and not very flexible so other solutions welcome for future!

=IFERROR(IFERROR(RIGHT(B2,LEN(B2)-FIND("\",B2,FIND("\",B2,FIND("\",B2,FIND("\",B2,FIND("\",B2,FIND("\",B2)+1)+1)+1)+1)+1)),RIGHT(B2,LEN(B2)-FIND("\",B2,FIND("\",B2,FIND("\",B2,FIND("\",B2,FIND("\",B2)+1)+1)+1)+1))),RIGHT(B2,LEN(B2)-FIND("\",B2,FIND("\",B2,FIND("\",B2,FIND("\",B2)+1)+1)+1)))

Happy to talk through how it works if anyone is interested!

replyReply Tue 31 Jan 2012, 15:11Trainer Mark said...

RE: RIght-to-left text searching

Hello Lisa,

Here's another alternative way of getting the name from the right,

=TRIM(RIGHT(SUBSTITUTE(E12,"\",REPT(CHAR(32),LEN(E12))),LEN(E12)))

Change E12 to the cell your path is in, hope it works.


If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?

Have a great day.
Regards,

Mark
Microsoft Office Specialist Trainer

Tue 7 Feb 2012: Automatically marked as resolved.

 

Please browse our web site to find out more about
advanced excel ms training and other Microsoft training courses.

Excel tip:

Viewing Many Worksheets

If there are more worksheets in your workbook than there is room to show all their tabs at the bottom of the screen - Right click on the navigation arrows. A list of all your worksheets is shown. You just click on the one that you want to access. If you have more than 15 worksheets, select in the list and choose your worksheet from hundreds.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard