Back

About MrExcel
Consulting Services
Learn Excel Resources
Challenge of the Month
MrExcel Seminars

Message Board

MrExcel Store
Podcast
Search
Contact
Home

 

 
Chris asks "What I actually need is a function that will examine a range of cells and returns a certain value if any one of the cells in the range contains a certain word. Is there such a function?"

Assuming this data is in A1:A4

{"Juan";
"Pablo";
"Gonzalez";
"Juan Pablo"}

And you want to test for the existance of "Juan", (Located in C1), you could use, for example:

{=IF(LEN(C1)*OR(ISNUMBER(SEARCH("*"&C1&"*",A1:A4))),"Exists","Doesn't Exist")}

=IF(LEN(C1)*ISNUMBER(MATCH("*"&C1&"*",A1:A4,0)),"Exists","Doesn't Exist")

=IF(LEN(C1)*COUNTIF(A1:A4,"*"&C1&"*"),"Exists","Doesn't Exist")

The first one is a CSE formula (Must be entered pressing Control Shift Enter), the second and third one are regular formulas.

First one is also case sensitive.

By Juan Pablo Gonzalez on 02-Mar-2002

MrExcel.com Consulting can be hired to implement this concept, or many other cool applications, with your data.

MrExcel.com provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures on this web site are provided "as is" and we do not guarantee that they can be used in all situations.

 

Excel is a registered trademark of the Microsoft® Corporation.

All contents Copyright 1998-2008 by MrExcel Consulting.