Parse cell value based on contents

C

Craig860

In follow up to my previous question,
if
A1=Joe(abc)
a2=Sam(bdc)
a3=Sarah

to get the contents of the paranthesis in b1,b2 however b3 be blank, how
would would the formula go so I can avoid #VALUE! in b3.
ie:
b1=abc
b2=bdc
b3=
=MID(G2,FIND("(",G2)+1,(FIND(")",G2)-FIND("(",G2)-1)) will give me the
parenthisi value in it's own cell. But if there is no parenthisis, I get
#VALUE! which makes the spreadsheet look sloppy.
 
T

T. Valko

Try this:

=IF(ISERR(FIND("(",A1)),A1,SUBSTITUTE(MID(A1,FIND("(",A1)+1,100),")",""))
 
T

T. Valko

Ooops!
=IF(ISERR(FIND("(",A1)),A1,SUBSTITUTE(MID(A1,FIND("(",A1)+1,100),")",""))

You wanted the cell left blank...

=IF(ISERR(FIND("(",A1)),"",SUBSTITUTE(MID(A1,FIND("(",A1)+1,100),")",""))
 
J

JMB

Another suggestion - which I got from one of your previous posts:

=SUBSTITUTE(MID(A1,FIND("(",A1&"(")+1,255),"(","")
 
J

JMB

Give yourself a pat on the back - you earned it! I must have copied the
formula to the clipboard before I fixed that parentheses thingy:

=SUBSTITUTE(MID(A1,FIND("(",A1&"(")+1,255),")","")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top