Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default IF cell contains certain text return value

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells which
include 'Check' or 'Checking' and return the text "Checking" if it contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks
  #2   Report Post  
Excel Super Guru
 
Posts: 1,867
Thumbs up Answer: IF cell contains certain text return value

Yes, I understand what you're trying to achieve. Here's how you can do it:
  1. Select the cell where you want to display the result.
  2. Type the following formula:

    Formula:
    =IF(OR(ISNUMBER(SEARCH("Check",A1)),ISNUMBER(SEARCH("Checking",A1))),"Checking","Doing"
    Note: Replace "A1" with the cell reference of the cell you want to check for the presence of "Check" or "Checking".
  3. Press Enter.

This formula uses the IF function to check if the cell contains either "Check" or "Checking". If it does, it returns "Checking". If it doesn't, it returns "Doing". The OR function is used to check if either "Check" or "Checking" is present in the cell. The ISNUMBER function is used to check if the SEARCH function returns a number (which indicates that the text was found).

You can then copy this formula to other cells in the row to check for the presence of "Check" or "Checking" in those cells as well.
__________________
I am not human. I am an Excel Wizard
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 523
Default IF cell contains certain text return value

If your row with the text was row 1, and you wanted row 2 to have
Doing/Checking in it, type the following in cell B1 and copy it along:

=IF(OR(A1="Check",A1="Checking"),"Checking","Doing ")


"Eán" wrote:

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells which
include 'Check' or 'Checking' and return the text "Checking" if it contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default IF cell contains certain text return value

Many thanks for this one slight problem is that the cell A1 contains words
too for example "Secondary Checking" or "Check process two" - so I need to
identify cells that contain "Check" or "Checking"?

"Sam Wilson" wrote:

If your row with the text was row 1, and you wanted row 2 to have
Doing/Checking in it, type the following in cell B1 and copy it along:

=IF(OR(A1="Check",A1="Checking"),"Checking","Doing ")


"Eán" wrote:

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells which
include 'Check' or 'Checking' and return the text "Checking" if it contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default IF cell contains certain text return value

If this is one cell
try
=IF(COUNTIF(A1,"*check*"),"Checking","Doing")

Since you mentioned row...try the below as well It checks for these words in
Cols A to J for the first row. Copy down as required.
=IF(COUNTIF(A1:J1,"*check*"),"Checking","Doing")

If this post helps click Yes
---------------
Jacob Skaria


"Eán" wrote:

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells which
include 'Check' or 'Checking' and return the text "Checking" if it contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default IF cell contains certain text return value

I tried using this wild card in a sumproduct, but it isnt working.

My forumula is:

=sumproduct(((E:E=$D9)*(B:B="*CPB*"))

Do I need to do something differently for sumproducts?

Thanks,



"Jacob Skaria" wrote:

If this is one cell
try
=IF(COUNTIF(A1,"*check*"),"Checking","Doing")

Since you mentioned row...try the below as well It checks for these words in
Cols A to J for the first row. Copy down as required.
=IF(COUNTIF(A1:J1,"*check*"),"Checking","Doing")

If this post helps click Yes
---------------
Jacob Skaria


"Eán" wrote:

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells which
include 'Check' or 'Checking' and return the text "Checking" if it contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default IF cell contains certain text return value


"Go Bucks!!!" wrote in message
...
I tried using this wild card in a sumproduct, but it isnt working.

My forumula is:

=sumproduct(((E:E=$D9)*(B:B="*CPB*"))

Do I need to do something differently for sumproducts?

Thanks,



"Jacob Skaria" wrote:

If this is one cell
try
=IF(COUNTIF(A1,"*check*"),"Checking","Doing")

Since you mentioned row...try the below as well It checks for these words
in
Cols A to J for the first row. Copy down as required.
=IF(COUNTIF(A1:J1,"*check*"),"Checking","Doing")

If this post helps click Yes
---------------
Jacob Skaria


"Eán" wrote:

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells
which
include 'Check' or 'Checking' and return the text "Checking" if it
contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default IF cell contains certain text return value

[Sorry about the bogus first posting. Fat fingers, I guess.]

"Go Bucks!!!" wrote:
I tried using this wild card in a sumproduct, but it isnt working.
[....]
=sumproduct(((E:E=$D9)*(B:B="*CPB*"))


What revision of Excel are you using? I know that E:E and B:B do not work
in Excel 2003. I don't know about Excel 2007.

Anyway, you cannot use wildcards in simple comparisons. You can use SEARCH
or FIND. Use FIND if you want the comparison to be case-sensitive.

=sumproduct( (E1:E100=$D9) * (iserror( find("CPB",B1:B100) )=false) )


----- original message -----

"Go Bucks!!!" wrote in message
...
I tried using this wild card in a sumproduct, but it isnt working.

My forumula is:

=sumproduct(((E:E=$D9)*(B:B="*CPB*"))

Do I need to do something differently for sumproducts?

Thanks,



"Jacob Skaria" wrote:

If this is one cell
try
=IF(COUNTIF(A1,"*check*"),"Checking","Doing")

Since you mentioned row...try the below as well It checks for these words
in
Cols A to J for the first row. Copy down as required.
=IF(COUNTIF(A1:J1,"*check*"),"Checking","Doing")

If this post helps click Yes
---------------
Jacob Skaria


"Eán" wrote:

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells
which
include 'Check' or 'Checking' and return the text "Checking" if it
contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default IF cell contains certain text return value

Hi Joe. I am using 2007.

I am still having trouble. I get the #VALUE! error.

I tried changing the formula to $B5:$B600. I tried find and search. That
didnt help. Perhaps its because of my data? Here is what I have...


My formula is...

=find("BNY", B5:B600)

Data example is...

Samsung - CPB BNY Dedicated
Samsung - Dispatch 1st year
Hardware - 3rd Party
Goldman - Consumables
zzzGoldman-Dedicated

The data is not consistent, so I cannot go by the number of spaces as with
LEFT(). I am looking for the word "Dedicated" somewhere in the string.

Thanks Joe...




"JoeU2004" wrote:

[Sorry about the bogus first posting. Fat fingers, I guess.]

"Go Bucks!!!" wrote:
I tried using this wild card in a sumproduct, but it isnt working.
[....]
=sumproduct(((E:E=$D9)*(B:B="*CPB*"))


What revision of Excel are you using? I know that E:E and B:B do not work
in Excel 2003. I don't know about Excel 2007.

Anyway, you cannot use wildcards in simple comparisons. You can use SEARCH
or FIND. Use FIND if you want the comparison to be case-sensitive.

=sumproduct( (E1:E100=$D9) * (iserror( find("CPB",B1:B100) )=false) )


----- original message -----

"Go Bucks!!!" wrote in message
...
I tried using this wild card in a sumproduct, but it isnt working.

My forumula is:

=sumproduct(((E:E=$D9)*(B:B="*CPB*"))

Do I need to do something differently for sumproducts?

Thanks,



"Jacob Skaria" wrote:

If this is one cell
try
=IF(COUNTIF(A1,"*check*"),"Checking","Doing")

Since you mentioned row...try the below as well It checks for these words
in
Cols A to J for the first row. Copy down as required.
=IF(COUNTIF(A1:J1,"*check*"),"Checking","Doing")

If this post helps click Yes
---------------
Jacob Skaria


"Eán" wrote:

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells
which
include 'Check' or 'Checking' and return the text "Checking" if it
contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks



  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default IF cell contains certain text return value

Correction: I said I was looking for "Dedicated", but I have "BNY" in my
formula. My error. Of course, the problem persists if you have dedicated in
the formula.




"Go Bucks!!!" wrote:

Hi Joe. I am using 2007.

I am still having trouble. I get the #VALUE! error.

I tried changing the formula to $B5:$B600. I tried find and search. That
didnt help. Perhaps its because of my data? Here is what I have...


My formula is...

=find("BNY", B5:B600)

Data example is...

Samsung - CPB BNY Dedicated
Samsung - Dispatch 1st year
Hardware - 3rd Party
Goldman - Consumables
zzzGoldman-Dedicated

The data is not consistent, so I cannot go by the number of spaces as with
LEFT(). I am looking for the word "Dedicated" somewhere in the string.

Thanks Joe...




"JoeU2004" wrote:

[Sorry about the bogus first posting. Fat fingers, I guess.]

"Go Bucks!!!" wrote:
I tried using this wild card in a sumproduct, but it isnt working.
[....]
=sumproduct(((E:E=$D9)*(B:B="*CPB*"))


What revision of Excel are you using? I know that E:E and B:B do not work
in Excel 2003. I don't know about Excel 2007.

Anyway, you cannot use wildcards in simple comparisons. You can use SEARCH
or FIND. Use FIND if you want the comparison to be case-sensitive.

=sumproduct( (E1:E100=$D9) * (iserror( find("CPB",B1:B100) )=false) )


----- original message -----

"Go Bucks!!!" wrote in message
...
I tried using this wild card in a sumproduct, but it isnt working.

My forumula is:

=sumproduct(((E:E=$D9)*(B:B="*CPB*"))

Do I need to do something differently for sumproducts?

Thanks,



"Jacob Skaria" wrote:

If this is one cell
try
=IF(COUNTIF(A1,"*check*"),"Checking","Doing")

Since you mentioned row...try the below as well It checks for these words
in
Cols A to J for the first row. Copy down as required.
=IF(COUNTIF(A1:J1,"*check*"),"Checking","Doing")

If this post helps click Yes
---------------
Jacob Skaria


"Eán" wrote:

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells
which
include 'Check' or 'Checking' and return the text "Checking" if it
contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks





  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 28
Default IF cell contains certain text return value


Joe,

I got it to work. I am not sure what I was doing wrong. Its a long
formula, so I just missed something somewhere.




Thanks,


"JoeU2004" wrote:

[Sorry about the bogus first posting. Fat fingers, I guess.]

"Go Bucks!!!" wrote:
I tried using this wild card in a sumproduct, but it isnt working.
[....]
=sumproduct(((E:E=$D9)*(B:B="*CPB*"))


What revision of Excel are you using? I know that E:E and B:B do not work
in Excel 2003. I don't know about Excel 2007.

Anyway, you cannot use wildcards in simple comparisons. You can use SEARCH
or FIND. Use FIND if you want the comparison to be case-sensitive.

=sumproduct( (E1:E100=$D9) * (iserror( find("CPB",B1:B100) )=false) )


----- original message -----

"Go Bucks!!!" wrote in message
...
I tried using this wild card in a sumproduct, but it isnt working.

My forumula is:

=sumproduct(((E:E=$D9)*(B:B="*CPB*"))

Do I need to do something differently for sumproducts?

Thanks,



"Jacob Skaria" wrote:

If this is one cell
try
=IF(COUNTIF(A1,"*check*"),"Checking","Doing")

Since you mentioned row...try the below as well It checks for these words
in
Cols A to J for the first row. Copy down as required.
=IF(COUNTIF(A1:J1,"*check*"),"Checking","Doing")

If this post helps click Yes
---------------
Jacob Skaria


"Eán" wrote:

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells
which
include 'Check' or 'Checking' and return the text "Checking" if it
contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks



  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default IF cell contains certain text return value

On Tuesday, June 30, 2009 at 4:38:01 PM UTC+7, Jacob Skaria wrote:
If this is one cell
try
=IF(COUNTIF(A1,"*check*"),"Checking","Doing")

Since you mentioned row...try the below as well It checks for these words in
Cols A to J for the first row. Copy down as required.
=IF(COUNTIF(A1:J1,"*check*"),"Checking","Doing")

If this post helps click Yes
---------------
Jacob Skaria


"Eán" wrote:

I have a row containing various text including the words 'Check' &
'Checking'; in a separate row I would like to identify all the cells which
include 'Check' or 'Checking' and return the text "Checking" if it contains
either 'Check' or 'Checking' or "Doing" if it doesn't.
Hope this makes sense?
Many thanks


what should I do, when I have to find 2 different texts ?
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
Enter text in a cell to return a text value in same cell Danno 24/7[_2_] Excel Discussion (Misc queries) 6 May 9th 08 06:26 AM
return the reference of a cell with certain text in it Kevin Excel Discussion (Misc queries) 2 November 30th 07 06:46 PM
Return cell reference as text tjc Excel Discussion (Misc queries) 1 August 31st 07 04:26 PM
lookup a text cell and return text Cristi R Excel Discussion (Misc queries) 4 August 2nd 06 02:41 PM
How do you make cell 2 return data if cell 1 contains text? jermsalerms Excel Discussion (Misc queries) 3 January 5th 06 10:44 PM


All times are GMT +1. The time now is 04:54 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"