ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   function with 'contain' (https://www.excelbanter.com/excel-worksheet-functions/75957-function-contain.html)

lucas

function with 'contain'
 
Hi Guys,

If e.g. in cell A1 I have following text 'Adam has 7 apples' is there any
formual that would return in e.g. cell A2 '1' or 'true' or whatever if A1 has
contains word 'Adam'. So in other words I'm looking for sth like this: = if
A1 contains 'Adam' then in A2 return 1; if not then return 0.

lucas

bpeltzer

function with 'contain'
 
=IF(ISERROR(FIND("Adam",A1)),0,1)

"lucas" wrote:

Hi Guys,

If e.g. in cell A1 I have following text 'Adam has 7 apples' is there any
formual that would return in e.g. cell A2 '1' or 'true' or whatever if A1 has
contains word 'Adam'. So in other words I'm looking for sth like this: = if
A1 contains 'Adam' then in A2 return 1; if not then return 0.

lucas


Bob Phillips

function with 'contain'
 
=ISNUMBER(FIND("Adam"),A1)

will return TRUE or FALSE

=--ISNUMBER(FIND("Adam"),A1)

will return 1 or 0

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"lucas" wrote in message
...
Hi Guys,

If e.g. in cell A1 I have following text 'Adam has 7 apples' is there any
formual that would return in e.g. cell A2 '1' or 'true' or whatever if A1

has
contains word 'Adam'. So in other words I'm looking for sth like this: =

if
A1 contains 'Adam' then in A2 return 1; if not then return 0.

lucas




Bob Phillips

function with 'contain'
 
BTW, use

=--ISNUMBER(SEARCH("Adam",A1))

if you don't need case-sensitive

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"lucas" wrote in message
...
Hi Guys,

If e.g. in cell A1 I have following text 'Adam has 7 apples' is there any
formual that would return in e.g. cell A2 '1' or 'true' or whatever if A1

has
contains word 'Adam'. So in other words I'm looking for sth like this: =

if
A1 contains 'Adam' then in A2 return 1; if not then return 0.

lucas




lucas

function with 'contain'
 
thx. it helps!

"bpeltzer" wrote:

=IF(ISERROR(FIND("Adam",A1)),0,1)

"lucas" wrote:

Hi Guys,

If e.g. in cell A1 I have following text 'Adam has 7 apples' is there any
formual that would return in e.g. cell A2 '1' or 'true' or whatever if A1 has
contains word 'Adam'. So in other words I'm looking for sth like this: = if
A1 contains 'Adam' then in A2 return 1; if not then return 0.

lucas


lucas

function with 'contain'
 
thx Bob!

"Bob Phillips" wrote:

BTW, use

=--ISNUMBER(SEARCH("Adam",A1))

if you don't need case-sensitive

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"lucas" wrote in message
...
Hi Guys,

If e.g. in cell A1 I have following text 'Adam has 7 apples' is there any
formual that would return in e.g. cell A2 '1' or 'true' or whatever if A1

has
contains word 'Adam'. So in other words I'm looking for sth like this: =

if
A1 contains 'Adam' then in A2 return 1; if not then return 0.

lucas






All times are GMT +1. The time now is 08:24 AM.

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