MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Comparing strings


Posted by C.Toland on May 15, 2001 8:41 AM

Looking for a way to search strings on likeness not exact ,,
such as "omr" IN "omr-real" or
"pbx" IN "pbx-virginia"
and return a 0 or 1 ,,
thanks in advance


Posted by Mark W. on May 15, 2001 8:51 AM

=ISNUMBER(SEARCH("*omr*","omr-real"))+0

Posted by IML on May 15, 2001 9:06 AM

I assumed you wanted to count the the total number of occurances.
If your data is in range A1:A5, you could use the following formula (hit control shift enter to enter this array)
=SUM(IF(ISERROR(SEARCH($C$1,A1:A5)),0,SEARCH($C$1,A1:A5)))

C1 is where you would enter the string you are looking for.

Good luck


Posted by IML on May 15, 2001 9:41 AM

This doesn't work at all!

I didn't even notice one of the mad (Mark, Aladin, Dave) men already responded