#1   Report Post  
Kel
 
Posts: n/a
Default If CONTAINS

Hi all!!!

Im trying to figure how in a "IF formula" you do the following,
Also i would like to have it for VB.
Thanx

IF(A1 CONTAINS (beetween other words) jump,TRUE,FALSE

say A1 contains text like this "i like to jump to the roof" or "to the roof
i lilke to jump" not in a particular position, return cell B1 to say "NO"

Thank you all.
  #2   Report Post  
Dave O
 
Posts: n/a
Default

The syntax is
=IF(SEARCH("jump",A1,1)0,TRUE,FALSE)

In VBA the code is
If InStr(1, Range("a1").Value, "jump") 0 Then

  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Wed, 10 Aug 2005 10:46:08 -0700, Kel wrote:

Hi all!!!

Im trying to figure how in a "IF formula" you do the following,
Also i would like to have it for VB.
Thanx

IF(A1 CONTAINS (beetween other words) jump,TRUE,FALSE

say A1 contains text like this "i like to jump to the roof" or "to the roof
i lilke to jump" not in a particular position, return cell B1 to say "NO"

Thank you all.


In Excel, you would use the FIND or SEARCH worksheet functions and, if the
#Value! error is returned, then the search string was not found.

In VBA you would use the InStr Function


--ron
  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

=if(isnumber(search("jump",a1)),true,false)

or even:
=isnumber(search("jump",a1))


Kel wrote:

Hi all!!!

Im trying to figure how in a "IF formula" you do the following,
Also i would like to have it for VB.
Thanx

IF(A1 CONTAINS (beetween other words) jump,TRUE,FALSE

say A1 contains text like this "i like to jump to the roof" or "to the roof
i lilke to jump" not in a particular position, return cell B1 to say "NO"

Thank you all.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"