ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SEARCH function help (https://www.excelbanter.com/excel-worksheet-functions/86717-search-function-help.html)

Eric Shamlin

SEARCH function help
 
Ok, I need to search for partial text matches in an IF statement.

the base formula goes like this:
=IF ((ISNUMBER(SEARCH("index", A1), "Indexed", "Not indexed")

what i need is basically the same thing.. but looking for more than one
search match.

ideally something like:

=IF((ISNUMBER(SEARCH("index" or "table" or "legend"), a1), "Indexed", "Not
Indexed")

Make sense?

Ron Coderre

SEARCH function help
 
Try something like this:

For text in A1
B1: =IF(MAX(COUNTIF(A1,{"*index*","*table*","*legend*" })),"","not ")&"indexed"

If A1 contains any of index, table, or legend the return value is "indexed";
otherwise "not indexed".

Is that something you can work with?

***********
Regards,
Ron

XL2002, WinXP-Pro


"Eric Shamlin" wrote:

Ok, I need to search for partial text matches in an IF statement.

the base formula goes like this:
=IF ((ISNUMBER(SEARCH("index", A1), "Indexed", "Not indexed")

what i need is basically the same thing.. but looking for more than one
search match.

ideally something like:

=IF((ISNUMBER(SEARCH("index" or "table" or "legend"), a1), "Indexed", "Not
Indexed")

Make sense?


Biff

SEARCH function help
 
Another way:

=IF(OR(ISNUMBER(SEARCH({"index","table","legend"}, A1))), "Indexed", "Not
Indexed")

Biff

"Eric Shamlin" wrote in message
...
Ok, I need to search for partial text matches in an IF statement.

the base formula goes like this:
=IF ((ISNUMBER(SEARCH("index", A1), "Indexed", "Not indexed")

what i need is basically the same thing.. but looking for more than one
search match.

ideally something like:

=IF((ISNUMBER(SEARCH("index" or "table" or "legend"), a1), "Indexed", "Not
Indexed")

Make sense?





All times are GMT +1. The time now is 05:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com