Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Conditional Formatting - comparison with another cell

I'm trying to get a cell highlighted if its value contains the (alphabetic)
value in another cell. I've got a rule in cell C16 of =B5 ="td" and this
correctly highlights when C16 and C5 are both set to 'td'.

But I want it to really to be 'contains' not '=' and then to be able to put
in a string of values 'td, ps, jc' and so on. So C16 could be set to 'JC/PS'
and would go red if C5 contained either 'JC' or 'PS'.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Conditional Formatting - comparison with another cell

First, do note that your first formula
=B5="td"

has no correlation to what is going on in C16. It only checks if B5 = "td".

As to your question, the CF formula is:
=ISNUMBER(SEARCH(C5,C16))

Note that if you want it to be case-sensitive, change SEARCH to FIND.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Jezza" wrote:

I'm trying to get a cell highlighted if its value contains the (alphabetic)
value in another cell. I've got a rule in cell C16 of =B5 ="td" and this
correctly highlights when C16 and C5 are both set to 'td'.

But I want it to really to be 'contains' not '=' and then to be able to put
in a string of values 'td, ps, jc' and so on. So C16 could be set to 'JC/PS'
and would go red if C5 contained either 'JC' or 'PS'.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default Conditional Formatting - comparison with another cell

Try:

=IF(ISERROR(FIND("td",B5)),FALSE,TRUE)

"Jezza" wrote:

I'm trying to get a cell highlighted if its value contains the (alphabetic)
value in another cell. I've got a rule in cell C16 of =B5 ="td" and this
correctly highlights when C16 and C5 are both set to 'td'.

But I want it to really to be 'contains' not '=' and then to be able to put
in a string of values 'td, ps, jc' and so on. So C16 could be set to 'JC/PS'
and would go red if C5 contained either 'JC' or 'PS'.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Conditional Formatting - comparison with another cell

You don't need
=IF(...,FALSE,TRUE)

=NOT(ISERROR(FIND("td",B5))) should do the job,
or =ISNUMBER(FIND("td",B5))
or =ISNUMBER(SEARCH("td",B5)) if you want the search to be case insensitive
which the OP wanted.
--
David Biddulph

"Sean Timmons" wrote in message
...
Try:

=IF(ISERROR(FIND("td",B5)),FALSE,TRUE)

"Jezza" wrote:

I'm trying to get a cell highlighted if its value contains the
(alphabetic)
value in another cell. I've got a rule in cell C16 of =B5 ="td" and this
correctly highlights when C16 and C5 are both set to 'td'.

But I want it to really to be 'contains' not '=' and then to be able to
put
in a string of values 'td, ps, jc' and so on. So C16 could be set to
'JC/PS'
and would go red if C5 contained either 'JC' or 'PS'.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default Conditional Formatting - comparison with another cell

Good tips. Thank you for the help!

"David Biddulph" wrote:

You don't need
=IF(...,FALSE,TRUE)

=NOT(ISERROR(FIND("td",B5))) should do the job,
or =ISNUMBER(FIND("td",B5))
or =ISNUMBER(SEARCH("td",B5)) if you want the search to be case insensitive
which the OP wanted.
--
David Biddulph

"Sean Timmons" wrote in message
...
Try:

=IF(ISERROR(FIND("td",B5)),FALSE,TRUE)

"Jezza" wrote:

I'm trying to get a cell highlighted if its value contains the
(alphabetic)
value in another cell. I've got a rule in cell C16 of =B5 ="td" and this
correctly highlights when C16 and C5 are both set to 'td'.

But I want it to really to be 'contains' not '=' and then to be able to
put
in a string of values 'td, ps, jc' and so on. So C16 could be set to
'JC/PS'
and would go red if C5 contained either 'JC' or 'PS'.



.

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
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
Conditional comparison of values. Graham Excel Worksheet Functions 6 July 31st 07 11:49 PM
Conditional Formatting across many cells with a mobile comparison JLatham Excel Discussion (Misc queries) 1 September 27th 06 06:37 AM
Excel Conditional Formatting - Two Dates Comparison [email protected] Excel Discussion (Misc queries) 2 August 21st 06 08:40 PM
String Comparison & Conditional Formatting Blobbies Excel Discussion (Misc queries) 3 April 18th 06 07:43 AM


All times are GMT +1. The time now is 01:23 PM.

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

About Us

"It's about Microsoft Excel"