Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Replacing a value within a string using a formula

Hello,

The following has happened, I created a formula
=MID(E90,FIND("*",SUBSTITUTE(E90,"\","*",LEN(E90)-LEN(SUBSTITUTE(E90,"\",""))))+1,LEN(E90))
It has the following function: cell 90 has a value
c:\windows\desktop\new\testing.xls
The formula gives back as a result in the cel where it is placed
:testing.xls

Now i want to use a formula that first get rid of testing.xls so you
that you have as value c:\windows\desktop\new\; then another formula
must substituse \new\ with \old\ so that the value in the cel wil be
c:\windows\desktop\old\

Does anybody knows how i can make this possible


Regards,
Niek



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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Replacing a value within a string using a formula

Hi,

Cell A1's value is "c:\windows\desktop\new\testing.xls"

This formula in B1
=MID(A1,1,SEARCH(MID(A1,FIND("*",SUBSTITUTE(A1,"\" ,"*",LEN(A1)-LEN(SUBSTITUT
E(A1,"\",""))))+1,LEN(A1)),A1)-1)

This formula in C1
=SUBSTITUTE(B1,"\new\","\old\")


--
Regards

Haldun Alay

To e-mail me, please remove AT and DOT from my e-mail address.



"solo_razor" , iletide şunu yazdı
...
Hello,

The following has happened, I created a formula

=MID(E90,FIND("*",SUBSTITUTE(E90,"\","*",LEN(E90)-LEN(SUBSTITUTE(E90,"\","")
)))+1,LEN(E90))
It has the following function: cell 90 has a value
c:\windows\desktop\new\testing.xls
The formula gives back as a result in the cel where it is placed
:testing.xls

Now i want to use a formula that first get rid of testing.xls so you
that you have as value c:\windows\desktop\new\; then another formula
must substituse \new\ with \old\ so that the value in the cel wil be
c:\windows\desktop\old\

Does anybody knows how i can make this possible


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
Replacing a formula with the actual string or number Erik Excel Discussion (Misc queries) 1 February 6th 10 06:17 AM
Extracting and replacing the first word in a String of text RAYCV Excel Worksheet Functions 5 August 21st 09 01:15 PM
Replacing numeric X-axis labels with corresponding text string Cinco Excel Discussion (Misc queries) 2 July 25th 09 11:13 PM
Replacing a random string of 5 numbers Katie59 Excel Discussion (Misc queries) 5 March 23rd 06 09:12 PM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


All times are GMT +1. The time now is 09:00 PM.

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"