find a character location in a string starting from the right

G

Guest

I have to find the second instance from the right in strings with a variable
number of segments delimited by ".", where the final string is reliably 6
characters and the remaining segments are of variable length.

Example string:
mypage.My_Details.Yorkshire_and_Humber_region_page.Accountants_shown_ways_of_going_for_Olympic_gold_.136277

From which I want to extract:
Accountants_shown_ways_of_going_for_Olympic_gold_.136277
 
B

Bob Phillips

=MID(A1,FIND("~",SUBSTITUTE(A1,".","~",LEN(A1)-LEN(SUBSTITUTE(A1,".",""))-1))+1,255)

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
G

Guest

Another way....

=REPLACE(A1,1,LOOKUP(LEN(A1)-7,FIND(".",A1,ROW(INDIRECT("1:"&LEN(A1))))),"")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top