Extracting the last word from a string.

C

Ciarán

I have a list in excel like the one below.
The filename is always after the last "/".
What formula can I use to extract the filename?
The number of instances of "/" is not cosistent in every path string.


../ABCD/home/ABCD/EFGH/ciaran
../ABCD/home/ABCD/EFGH/bin/paul
../ABCD/home/james
../ABCD/home/ABCD/EFGH/bin/partition

The results I would like are:
ciaran
paul
james
partition
 
M

Mike H

Hi,

Try this

=RIGHT(A1,LEN(A1)-FIND("*",SUBSTITUTE(A1,"/","*",LEN(A1)-LEN(SUBSTITUTE(A1,"/","")))))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 

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