Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Boolean Operaters to equal 'Contained Within'



HI

I'm using this formula :

=IF(K1="AB",5,6)

This places a number 5 in the target column if K1 contains the letters
"AB" , and a 6 if it doesn't.

The problem is that it only works for if the content is *exactly* "AB".
If there is any other content in the cell , it returns a false
conclusion.

What I really need is for this to work if the letters "AB" are contained
*anywhere* within the text in K1.

Is this possible?

Grateful for any help.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default Boolean Operaters to equal 'Contained Within'

Try this:

=6-COUNTIF(K1,"*AB*")

Is that something you can work with?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
"Colin Hayes" wrote in message
...


HI

I'm using this formula :

=IF(K1="AB",5,6)

This places a number 5 in the target column if K1 contains the letters
"AB" , and a 6 if it doesn't.

The problem is that it only works for if the content is *exactly* "AB". If
there is any other content in the cell , it returns a false conclusion.

What I really need is for this to work if the letters "AB" are contained
*anywhere* within the text in K1.

Is this possible?

Grateful for any help.




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 272
Default Boolean Operaters to equal 'Contained Within'

=IF(COUNTIF(K1,"*AB*"),5,6)

"Colin Hayes" wrote:



HI

I'm using this formula :

=IF(K1="AB",5,6)

This places a number 5 in the target column if K1 contains the letters
"AB" , and a 6 if it doesn't.

The problem is that it only works for if the content is *exactly* "AB".
If there is any other content in the cell , it returns a false
conclusion.

What I really need is for this to work if the letters "AB" are contained
*anywhere* within the text in K1.

Is this possible?

Grateful for any help.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default Boolean Operaters to equal 'Contained Within'

hi
try this.

=IF(FIND("AB",A1)0,1,2)

if the formula retuns #Value!, AB not found.
adjust to suit your data.

Regards
FSt1

"Colin Hayes" wrote:



HI

I'm using this formula :

=IF(K1="AB",5,6)

This places a number 5 in the target column if K1 contains the letters
"AB" , and a 6 if it doesn't.

The problem is that it only works for if the content is *exactly* "AB".
If there is any other content in the cell , it returns a false
conclusion.

What I really need is for this to work if the letters "AB" are contained
*anywhere* within the text in K1.

Is this possible?

Grateful for any help.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default Boolean Operaters to equal 'Contained Within'

hi.
had a brain burp. don't use this fomula. it denys the else part
use this instead

=IF(COUNTIF(K1,"*AB*"),5,6)

sorry about that.

Regards
FSt1

"FSt1" wrote:

hi
try this.

=IF(FIND("AB",A1)0,1,2)

if the formula retuns #Value!, AB not found.
adjust to suit your data.

Regards
FSt1

"Colin Hayes" wrote:



HI

I'm using this formula :

=IF(K1="AB",5,6)

This places a number 5 in the target column if K1 contains the letters
"AB" , and a 6 if it doesn't.

The problem is that it only works for if the content is *exactly* "AB".
If there is any other content in the cell , it returns a false
conclusion.

What I really need is for this to work if the letters "AB" are contained
*anywhere* within the text in K1.

Is this possible?

Grateful for any help.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Boolean Operaters to equal 'Contained Within'

=6-ISNUMBER(SEARCH("AB",K1))


"Colin Hayes" wrote:



HI

I'm using this formula :

=IF(K1="AB",5,6)

This places a number 5 in the target column if K1 contains the letters
"AB" , and a 6 if it doesn't.

The problem is that it only works for if the content is *exactly* "AB".
If there is any other content in the cell , it returns a false
conclusion.

What I really need is for this to work if the letters "AB" are contained
*anywhere* within the text in K1.

Is this possible?

Grateful for any help.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Boolean Operaters to equal 'Contained Within'

In article , Lori
writes
=IF(COUNTIF(K1,"*AB*"),5,6)



Hi

OK thanks for that. Worked perfectly , first time.

Out of interest , could this formula be extended to include a second
criterion so that it would check if "AB" OR "CD" were present before
giving the true or false conclusion?


Thanks again.



"Colin Hayes" wrote:



HI

I'm using this formula :

=IF(K1="AB",5,6)

This places a number 5 in the target column if K1 contains the letters
"AB" , and a 6 if it doesn't.

The problem is that it only works for if the content is *exactly* "AB".
If there is any other content in the cell , it returns a false
conclusion.

What I really need is for this to work if the letters "AB" are contained
*anywhere* within the text in K1.

Is this possible?

Grateful for any help.





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 256
Default Boolean Operaters to equal 'Contained Within'

=IF(OR(COUNTIF(K1,"*AB*"),COUNTIF(K1,"*CD*")),5,6)


On Feb 8, 1:45 pm, Colin Hayes wrote:
In article , Lori
writes

=IF(COUNTIF(K1,"*AB*"),5,6)


Hi

OK thanks for that. Worked perfectly , first time.

Out of interest , could this formula be extended to include a second
criterion so that it would check if "AB" OR "CD" were present before
giving the true or false conclusion?

Thanks again.



"Colin Hayes" wrote:


HI


I'm using this formula :


=IF(K1="AB",5,6)


This places a number 5 in the target column if K1 contains the letters
"AB" , and a 6 if it doesn't.


The problem is that it only works for if the content is *exactly* "AB".
If there is any other content in the cell , it returns a false
conclusion.


What I really need is for this to work if the letters "AB" are contained
*anywhere* within the text in K1.


Is this possible?


Grateful for any help.


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 465
Default Boolean Operaters to equal 'Contained Within'

In article
, ilia
writes
=IF(OR(COUNTIF(K1,"*AB*"),COUNTIF(K1,"*CD*")),5,6 )


Hi

OK That's perfect - thanks for that.


Best wishes.



On Feb 8, 1:45 pm, Colin Hayes wrote:
In article , Lori
writes

=IF(COUNTIF(K1,"*AB*"),5,6)


Hi

OK thanks for that. Worked perfectly , first time.

Out of interest , could this formula be extended to include a second
criterion so that it would check if "AB" OR "CD" were present before
giving the true or false conclusion?

Thanks again.



"Colin Hayes" wrote:


HI


I'm using this formula :


=IF(K1="AB",5,6)


This places a number 5 in the target column if K1 contains the letters
"AB" , and a 6 if it doesn't.


The problem is that it only works for if the content is *exactly* "AB".
If there is any other content in the cell , it returns a false
conclusion.


What I really need is for this to work if the letters "AB" are contained
*anywhere* within the text in K1.


Is this possible?


Grateful for any help.



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


Similar Threads
Thread Thread Starter Forum Replies Last Post
More on Boolean Epinn New Users to Excel 7 November 28th 06 09:29 AM
Bob P. and Roger G. -- IF(and(...IF(OR( vs. IF(Boolean Epinn Excel Worksheet Functions 21 November 19th 06 08:38 PM
SUMIF boolean? Daminc Excel Worksheet Functions 12 May 4th 06 05:21 PM
VBA Boolean Jeff Excel Discussion (Misc queries) 1 February 2nd 06 10:01 PM
Boolean Find Bill Excel Discussion (Misc queries) 2 May 31st 05 10:52 PM


All times are GMT +1. The time now is 10:02 AM.

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"