View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld
 
Posts: n/a
Default Find text within text

On Mon, 20 Mar 2006 10:51:30 -0800, Jambruins
wrote:

Ron,
That works great except I should have added another row as some of the
rows do not have the @ symbol. Here is an example of a row without the @
symbol: 05/08/2005 Seattle L 4-6 R. Franklin (R) W. Miller (R) -140/10u
-125 L/P

How would I change the formula? Thanks for your help.


It looks to me that one method of identifying the desired segment is that it
starts with the first capital letter in the string and ends with a capital L or
W that is surrounded by a <space.

You can do this with regular expressions but you must download and install
Longre's free morefunc.xll add-in from

Then use the formula:

=REGEX.MID(A1,"[A-Z]([\sA-Za-z0-9])+(?=\s[LW]\s)")

Since the formula may leave a terminal space if there are two spaces between
the team name and the W or L, you could TRIM the result to eliminate that:

=TRIM(REGEX.MID(A1,"[A-Z]([\sA-Za-z0-9])+(?=\s[LW]\s)"))


--ron