Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Extract text between symbols

I would like to extract text from a string which will contain:

<sometext/the text I want/<sometext

The beginning and ending text will vary in length, but the text I want will
be between the two "/".

I am also looking to extract the text after the second "/", in a different
operation.

The data will change, so I want to write this as a template.

Any help is appreciated.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Extract text between symbols

With text in cel A1

Try something like this:
B1: =LEFT(MID(A1,FIND("/",A1)+1,255),FIND("/",MID(A1,FIND("/",A1)+1,255))-1)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"billinr" wrote:

I would like to extract text from a string which will contain:

<sometext/the text I want/<sometext

The beginning and ending text will vary in length, but the text I want will
be between the two "/".

I am also looking to extract the text after the second "/", in a different
operation.

The data will change, so I want to write this as a template.

Any help is appreciated.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Extract text between symbols

try this
Sub extracttext()
For Each c In Selection
fb = InStr(1, c, "/") + 1
'MsgBox fb
sb = InStr(fb + 1, c, "/")
'MsgBox sb
ms = Mid(c, fb, sb - fb)
MsgBox ms
rest = Right(c, Len(c) - sb)
MsgBox rest

Next c
End Sub

--
Don Guillett
SalesAid Software

"billinr" wrote in message
...
I would like to extract text from a string which will contain:

<sometext/the text I want/<sometext

The beginning and ending text will vary in length, but the text I want
will
be between the two "/".

I am also looking to extract the text after the second "/", in a different
operation.

The data will change, so I want to write this as a template.

Any help is appreciated.

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Extract text between symbols

On Mon, 30 Apr 2007 12:12:01 -0700, billinr
wrote:

I would like to extract text from a string which will contain:

<sometext/the text I want/<sometext

The beginning and ending text will vary in length, but the text I want will
be between the two "/".

I am also looking to extract the text after the second "/", in a different
operation.

The data will change, so I want to write this as a template.

Any help is appreciated.

Thanks


If the strings are less than 256 characters long, then you could download and
install Longre's free (and easily distributable) morefunc.xll add-in from
http://xcell05.free.fr/.

Then use this formula:

=REGEX.MID(A1,"(?<=/).*?(?=/)")


--ron
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Extract text between symbols

On Mon, 30 Apr 2007 15:59:04 -0400, Ron Rosenfeld
wrote:

On Mon, 30 Apr 2007 12:12:01 -0700, billinr
wrote:

I would like to extract text from a string which will contain:

<sometext/the text I want/<sometext

The beginning and ending text will vary in length, but the text I want will
be between the two "/".

I am also looking to extract the text after the second "/", in a different
operation.

The data will change, so I want to write this as a template.

Any help is appreciated.

Thanks


If the strings are less than 256 characters long, then you could download and
install Longre's free (and easily distributable) morefunc.xll add-in from
http://xcell05.free.fr/.

Then use this formula:

=REGEX.MID(A1,"(?<=/).*?(?=/)")


--ron


Oh, for the text after the second "/"

=REGEX.SUBSTITUTE(A1,".*/.*/")
--ron


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Extract text between symbols

Thank you. This worked well for the text between the symbols.
Could you offer something that would find the text after the second "/"?

TIA

"Ron Coderre" wrote:

With text in cel A1

Try something like this:
B1: =LEFT(MID(A1,FIND("/",A1)+1,255),FIND("/",MID(A1,FIND("/",A1)+1,255))-1)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"billinr" wrote:

I would like to extract text from a string which will contain:

<sometext/the text I want/<sometext

The beginning and ending text will vary in length, but the text I want will
be between the two "/".

I am also looking to extract the text after the second "/", in a different
operation.

The data will change, so I want to write this as a template.

Any help is appreciated.

Thanks

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Extract text between symbols

Try this:

=MID(A1,FIND("/",A1,FIND("/",A1)+1)+1,255)

Biff

"billinr" wrote in message
...
Thank you. This worked well for the text between the symbols.
Could you offer something that would find the text after the second "/"?

TIA

"Ron Coderre" wrote:

With text in cel A1

Try something like this:
B1:
=LEFT(MID(A1,FIND("/",A1)+1,255),FIND("/",MID(A1,FIND("/",A1)+1,255))-1)

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"billinr" wrote:

I would like to extract text from a string which will contain:

<sometext/the text I want/<sometext

The beginning and ending text will vary in length, but the text I want
will
be between the two "/".

I am also looking to extract the text after the second "/", in a
different
operation.

The data will change, so I want to write this as a template.

Any help is appreciated.

Thanks



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
I get # symbols in my cell instead of text Betsy Excel Discussion (Misc queries) 12 June 9th 08 05:49 PM
Why does text in a cell appear as a line of '#' symbols? Kramer Excel Discussion (Misc queries) 3 March 8th 07 08:13 PM
how to remove symbols ahead of text and numbers copied from web Dan B Excel Worksheet Functions 8 February 9th 07 02:49 AM
Text & symbols in the same drop-down list Rachael F Excel Discussion (Misc queries) 0 June 8th 06 12:48 PM
EXTRACT TEXT FROM TEXT STRING carricka Excel Worksheet Functions 4 July 8th 05 11:00 AM


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

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"