Finding words

L

laurag

Hi.

I'm looking for a fonction or a macro to know if, in a reaserch, the
excel found or if he didn't find what a asked (I use function find at
text category to find words).

Exemple:
If he found at least 1 element, he returns 1.
If he found nothing, he returns 0.

Can you help me?

thanks
 
D

Dave Peterson

Maybe you can use =countif()

If you're looking for "research" anywhere in a1:A10, you could use:

=if(countif(a1:a10,"research")>0,1,0)
if "research" could be part of a longer string within any of those cells:
=if(countif(a1:a10,"*"&"research"&"*")>0,1,0)
 
B

Bernie Deitrick

Laura,

=COUNTIF(A:A, "Laura")
to count cells that are exactly Laura in column A, or
=COUNTIF(A:A, "*Laura*")
to count cells that contain Laura in column A.

HTH,
Bernie
MS Excel MVP
 
Top