Search / Mid function

G

Guest

Hi, I want to return the words/ string of words after the last divider "/".
e.g. in Column A, there are
Society/Education/University/USA
Society/Education/University/USA/University of Chicago
Family/babies
Leisure/Outdoor/camping

I want to return:
USA
University of Chicago
babies
camping
in Column B.

The number of "/" is variable in each row.

I only know how to return the value after a specific count of "/", like:
=mid(a1, search("/", A1, 2), Len(A1)) to return University/USA
But I don't know how to return the value counting from the last "/".
Can anyone help me?

Thanks!
 
R

RagDyer

Try this:

=RIGHT(A1,LEN(A1)-SEARCH("^^^",SUBSTITUTE(A1,"/","^^^",LEN(A1)-LEN(SUBSTITUTE(A1,"/","")))))
 
D

Domenic

Assuming that A2 contains the text string, try...

=REPLACE(A2,1,FIND("^^",SUBSTITUTE(A2,"/","^^",LEN(A2)-LEN(SUBSTITUTE(A2,
"/","")))),"")

Hope this helps!
 

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