Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Extracting the last word from a string.

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 a
ciaran
paul
james
partition
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Extracting the last word from a string.

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.


"Ciarán" wrote:

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 a
ciaran
paul
james
partition
.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Extracting the last word from a string.

=TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",99)),99))


"Ciarán" wrote:

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 a
ciaran
paul
james
partition
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extracting a word form a text string John Calder New Users to Excel 8 October 21st 09 06:04 PM
Extracting and replacing the first word in a String of text RAYCV Excel Worksheet Functions 5 August 21st 09 01:15 PM
Extracting a word from a text string Nadeem Excel Discussion (Misc queries) 3 October 12th 06 09:17 AM
Extracting a string Peter Rooney Excel Discussion (Misc queries) 5 June 20th 06 06:34 PM
Extracting from a text string AmyTaylor Excel Worksheet Functions 3 June 24th 05 01:34 PM


All times are GMT +1. The time now is 06:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"