find text in cell

  • Thread starter Thread starter Bonnie
  • Start date Start date
B

Bonnie

Hi,

I am trying to do something like this:

if(instr("ABC",A1),A1,""))

Doesn't work? If ABC is found in A1 I would like to copy A1 to B1 (leave B1
blank if not).

Thanks in advance for any help you can give.
 
Instr is a VBA function.

You can use =search() or =find():

=if(isnumber(search("abc",a1),a1,"")

=find() is case sensitive.
=search() is not.

Another alternative (not case sensitive):

=if(countif(a1,"*abc*")>0,a1,"")
 
That's what I was looking for Dave. Thanks so much for your kindness in
taking the time.

Bonnie
 

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

Back
Top