Finding a string within a string

  • Thread starter Thread starter Sandra
  • Start date Start date
This is one way to do i

"=MID(A3;FIND("(";A1)+1;(FIND(")";A1)-FIND("(";A1))-1)
 
Hi Don
not sure but if you use TRIM within FIND I would use it as well for the
first parameter:
=LEFT(TRIM(E1),FIND("(",TRIM(E1))-1)&TRIM(RIGHT(E1,LEN(E1)-FIND(")",E1)
))

or did you mean:
=TRIM(LEFT(E1,FIND("(",E1)-1))&TRIM(RIGHT(E1,LEN(E1)-FIND(")",E1)))
 
I don't think I did what OP wanted anyway. I took out the text he wanted and
left the rest.
 
Yes. It's the stuff inside the parentheses that I want to keep, not drop.
Although that's a nice trick I'll keep for later use. Thanks

The first response doesn't work for me and I don't know what I'm doing
wrong.
 
"=MID(A3;FIND("(";A1)+1;(FIND(")";A1)-FIND("(";A1))-1)"

I can't figure it out. If you look at my original question below, you see
that A3 and A1 are both cells that have the data I want to convert so I'm
not sure what this is trying to do. Too much for my pea brain. If A1 has the
source data and I change the reference of cell A3 to A1 it doesn't work.
 
Hi
for cell A1 use:
=MID(A1;FIND("(";A1)+1;FIND(")";A1)-FIND("(";A1)-1)

and for cell A3 you have to change ALL cell references:
=MID(A3;FIND("(";A3)+1;FIND(")";A3)-FIND("(";A3)-1)
 
It doesn't like me. Could you please plug this and my data string into an
excel file and see what it does for you? It just says "The formula you typed
contains an error."
 
Hi
if you like email me an example file. you may also try replacing the
semicolons with comas

email: frank[dot]kabel[at]freenet[dot]de



egards
Frank Kabel
Frankfurt, Germany
 
The comma thing worked. Thank you VERY much!

Frank Kabel said:
Hi
if you like email me an example file. you may also try replacing the
semicolons with comas

email: frank[dot]kabel[at]freenet[dot]de



egards
Frank Kabel
Frankfurt, Germany

It doesn't like me. Could you please plug this and my data string
into an excel file and see what it does for you? It just says "The
formula you typed contains an error."
 
New problem - suppose the string is
aaa ([email protected]) ddd
or
aaaaaaaaaaaaa ([email protected]) dddddddddd
and you want only the string after the open parenthesis and before the @
???

So the results for these 2 strings would be either bbb or bbbbbbbbbbbbbbbb




Sandra said:
The comma thing worked. Thank you VERY much!

Frank Kabel said:
Hi
if you like email me an example file. you may also try replacing the
semicolons with comas

email: frank[dot]kabel[at]freenet[dot]de



egards
Frank Kabel
Frankfurt, Germany

It doesn't like me. Could you please plug this and my data string
into an excel file and see what it does for you? It just says "The
formula you typed contains an error."

Hi
for cell A1 use:
=MID(A1;FIND("(";A1)+1;FIND(")";A1)-FIND("(";A1)-1)

and for cell A3 you have to change ALL cell references:
=MID(A3;FIND("(";A3)+1;FIND(")";A3)-FIND("(";A3)-1)


--
Regards
Frank Kabel
Frankfurt, Germany


Sandra wrote:
"=MID(A3;FIND("(";A1)+1;(FIND(")";A1)-FIND("(";A1))-1)"

I can't figure it out. If you look at my original question below,
you see that A3 and A1 are both cells that have the data I want to
convert so I'm not sure what this is trying to do. Too much for my
pea brain. If A1 has the source data and I change the reference of
cell A3 to A1 it doesn't work.


Hi
what is the exact formula you have tried and what is the wrong
result?

--
Regards
Frank Kabel
Frankfurt, Germany


Sandra wrote:
Yes. It's the stuff inside the parentheses that I want to keep,
not drop. Although that's a nice trick I'll keep for later use.
Thanks

The first response doesn't work for me and I don't know what I'm
doing wrong.

I don't think I did what OP wanted anyway. I took out the text he
wanted and left the rest.

--
Don Guillett
SalesAid Software
(e-mail address removed)
Hi Don
not sure but if you use TRIM within FIND I would use it as well
for the first parameter:


=LEFT(TRIM(E1),FIND("(",TRIM(E1))-1)&TRIM(RIGHT(E1,LEN(E1)-FIND(")",E1)
))

or did you mean:

=TRIM(LEFT(E1,FIND("(",E1)-1))&TRIM(RIGHT(E1,LEN(E1)-FIND(")",E1)))

--
Regards
Frank Kabel
Frankfurt, Germany

with a formula


=LEFT(E1,FIND("(",TRIM(E1))-1)&TRIM(RIGHT(E1,LEN(E1)-FIND(")",E1)))
--
Don Guillett
SalesAid Software
(e-mail address removed)
Let's say
A1 = aaaaaaa aaaaaaa ([email protected])
eeeeeeeeeeeeeeeeeeeeeeeeeeee A2 = aaa aaaaaaa
([email protected]) eee
A3 = aaaaaa aaaaaaaaaaa ([email protected]) ee e e.eee


I want to pull out everything within the parentheses. I'm
trying to figure out how to do this with a combination of Left
and Search commands but I'm too stupid. HELP!
 
Back
Top