View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default Can I create an IF statement that looks for part of a string of te

One way ..

Try in say, C1, something like:
=IF(ISNUMBER(SEARCH("version 1 ",TRIM(B1))),"Y","N")

Replace "Yes", "No", with whatever you want as the if_TRUE/if_FALSE returns

Note that the single space after the "1" in the search string: "version 1 "
is intentional, so that it doesn't evaluate as TRUE for strings such as:
version 123, version 111, etc. But if you want it otherwise, just remove the
single space.

Replace SEARCH with FIND in the formula if you need it to be case sensitive
(SEARCH is not case sensitive)
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Josh Craig" wrote:
I want to create a condition for an IF() formula based on part of the text in
an adjacent cell.

For example:

So if B1 contains the phrase "version 1" return one value and return another
if it doesn't have it.

But I don't mean B1 is exactly equal to "version 1" but rather that it
contains "version 1" someone in the text of that cell. Is there some way I
can accomplish this?

Effectively I want it to be able to test if B1=*"version 1" where * equals a
wildcard like on a search engine.