View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default finding rightmost location of a character

Here's one way:

With your text in Cell A1
B1: =LEN(A1)+1-MATCH("/",MID(A1,LEN(A1)+1-ROW(INDIRECT("1:"&(LEN(A1)))),1),0)
Note: Commit that array formula by holding down the [Ctrl][Shift] keys and
press [Enter].

Here's another way:
B1:
=LEN(LEFT(A1,SEARCH("^^",SUBSTITUTE(A1,"/","^^",LEN(A1)-LEN(SUBSTITUTE(A1,"/",""))))-1))+1

Just press [Enter] for that one.

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"KingGeezer" wrote:

I have a text string (a directory path actually) that has several "/"
characters in it.
I'd like to find the location of the right-most occurrance of an "/".
For example, if the string was: "mama/poppa/bogus/dog" .... how do I find
the position number of the "/" right before 'dog'?
Thanks for any help you can provide!