Another Thread extraction question!

jcopen

New Member
Joined
Aug 1, 2009
Messages
2
I want a formula that will take a filepath reference and yield only the filename, for example:

Cell A1 contains:

<TABLE style="WIDTH: 402pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=536 x:str><COLGROUP><COL style="WIDTH: 402pt; mso-width-source: userset; mso-width-alt: 19602" width=536><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; WIDTH: 402pt; HEIGHT: 12.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" height=17 width=536>C:\Documents and Settings\Joel\My Documents\My Music\From Smile\KotoStrum.L.wav</TD></TR></TBODY></TABLE>

I want a formula that yields:

KotoStrum.L.wav

What makes it more complex is that I want it to work on filepaths of various origins and depths. Essentially, I need something that would find the LAST occurrance of "\", then I could use any of several methods I already know to grab what follows that last occurrance. So far, I haven't found any trick that will find last occurrance or search from right to left, either of which would nail it for me. Any help would be much appreciated! Thank you.
 

Sandeep Warrier

Board Regularmmmm Pizza
Joined
Oct 31, 2008
Messages
2,672
I want a formula that will take a filepath reference and yield only the filename, for example:

Cell A1 contains:<table style="width: 402pt; border-collapse: collapse;" x:str="" width="536" border="0" cellpadding="0" cellspacing="0"><colgroup><col style="width: 402pt;" width="536"></colgroup><tbody><tr style="height: 12.75pt;" height="17"><td style="border: medium none rgb(212, 208, 200); background-color: transparent; width: 402pt; height: 12.75pt;" width="536" height="17">C:\Documents and Settings\Joel\My Documents\My Music\From Smile\KotoStrum.L.wav

I want a formula that yields:

KotoStrum.L.wav

What makes it more complex is that I want it to work on filepaths of various origins and depths. Essentially, I need something that would find the LAST occurrance of "\", then I could use any of several methods I already know to grab what follows that last occurrance. So far, I haven't found any trick that will find last occurrance or search from right to left, either of which would nail it for me. Any help would be much appreciated! Thank you.
Hi,

Welcome to the Board....
Perhaps this will help...
Excel Workbook
AB
1C:\Documents and Settings\Joel\My Documents\My Music\From Smile\KotoStrum.L.wavKotoStrum.L.wav
Sheet3
Excel 2003
Cell Formulas
Range(s)Formula
B1=TRIM(RIGHT(SUBSTITUTE(A1,"\",REPT(" ",255)),255))
 
Last edited:

jcopen

New Member
Joined
Aug 1, 2009
Messages
2
SanDeep,

Wow, that is really slick! Especially the 255 for the Windows file length limit. Thank you so much!

jcopen
 

Forum statistics

Threads
1,082,126
Messages
5,363,315
Members
400,725
Latest member
excelingtolearn

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top