Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default extract a foldername with a formula

hello,

I have a problem with a formula
my formula begins with
=MID(B102,FIND("*",SUBSTITUTE(B102,"\","*",LEN(B10 2)-LEN(SUBSTITUTE(B102,"\",""))))+1,LEN(B102))

This formula extracts from cell b102 a filename e.g.
c:\windows\desktop\newfile.xls (b102)
In the cell with the formula the value is then newfile.xls

Now i want to extract from b102 (c:\windows\desktop\new.xls)
c:\windows
Does anybody know how this can made possible?

Regards,

Niek



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default extract a foldername with a formula

one way:

=LEFT(B102, FIND("\",B102,4)-1)

In article ,
solo_razor wrote:

hello,

I have a problem with a formula
my formula begins with
=MID(B102,FIND("*",SUBSTITUTE(B102,"\","*",LEN(B10 2)-LEN(SUBSTITUTE(B102,"\","
"))))+1,LEN(B102))

This formula extracts from cell b102 a filename e.g.
c:\windows\desktop\newfile.xls (b102)
In the cell with the formula the value is then newfile.xls

Now i want to extract from b102 (c:\windows\desktop\new.xls)
c:\windows
Does anybody know how this can made possible?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default extract a foldername with a formula

hello,

The formula is incomplete, i must extract different filename's
E.G.
c:\program files\eag\dir\testing\test.xls

Now the formula must extract c:\program files\eag\dir\

another example:
c:\windows\system\systemroot\test\testing.xls

The formula must extract c:\windows\system\systemroot\

So you can see, the formula must extract the file and its folder, so 2
steps

I can't get it to work, hope you can

Regards,
Niek



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default extract a foldername with a formula

=Left(B102,len(B102)-len(cell with your formula that extracted the
filename))


"solo_razor" wrote in message
...
hello,

The formula is incomplete, i must extract different filename's
E.G.
c:\program files\eag\dir\testing\test.xls

Now the formula must extract c:\program files\eag\dir\

another example:
c:\windows\system\systemroot\test\testing.xls

The formula must extract c:\windows\system\systemroot\

So you can see, the formula must extract the file and its folder, so 2
steps

I can't get it to work, hope you can

Regards,
Niek



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default extract a foldername with a formula

Try:

=MID(B102,FIND(CHAR(22),SUBSTITUTE(B102,"\",CHAR(2 2),LEN(B102)-LEN(SUBSTITUTE(B102,"\",""))-1))+1,999)

or possibly:

=MID(B102,1,FIND(CHAR(22),SUBSTITUTE(B102,"\",CHAR (22),LEN(B102)-LEN(SUBSTITUTE(B102,"\",""))-1)))

solo_razor wrote in message ...
hello,

The formula is incomplete, i must extract different filename's
E.G.
c:\program files\eag\dir\testing\test.xls

Now the formula must extract c:\program files\eag\dir\

another example:
c:\windows\system\systemroot\test\testing.xls

The formula must extract c:\windows\system\systemroot\

So you can see, the formula must extract the file and its folder, so 2
steps

I can't get it to work, hope you can

Regards,
Niek



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



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
Extract Formula to Text Elton Law Excel Worksheet Functions 6 April 8th 09 11:20 AM
How to extract the url in a hyperlink using a formula pako_1972 Excel Worksheet Functions 1 September 7th 06 05:08 AM
Search/Extract Formula M Moore Excel Discussion (Misc queries) 5 August 29th 06 04:28 AM
Extract Date from Right Formula [email protected] Excel Worksheet Functions 3 July 18th 06 11:41 PM
Extract Unique Values, Then Extract Again to Remove Suffixes Karl Burrows Excel Discussion (Misc queries) 23 June 25th 05 10:37 PM


All times are GMT +1. The time now is 11:43 PM.

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

About Us

"It's about Microsoft Excel"