ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Using Logical OR on text in Conditional Formatting (https://www.excelbanter.com/excel-worksheet-functions/256299-using-logical-text-conditional-formatting.html)

Darius Poli

Using Logical OR on text in Conditional Formatting
 
I have a column with various text entries. I have created a conditional formatting rule for each type of entry but the formatting can be grouped together, so I would like a Conditional Formatting rule that says:

If string contains "foo" or "bar" then colour red
If string does not contain "yibble" or "wibble" then make bold
etc.

Any idea how I can do this rather thasn having to manage over 30 rules with each one looking for a single text entry type.

Thanks

Darius

---
frmsrcurl: http://msgroups.net/microsoft.public...heet.functions

Bob Phillips[_4_]

Using Logical OR on text in Conditional Formatting
 
Try a formula of

=OR(A2="foo",A2="bar")

=AND(A2<"yibble",A2<"wibble")

HTH

Bob

"Darius Poli" / wrote in message
...
I have a column with various text entries. I have created a conditional
formatting rule for each type of entry but the formatting can be grouped
together, so I would like a Conditional Formatting rule that says:

If string contains "foo" or "bar" then colour red
If string does not contain "yibble" or "wibble" then make bold
etc.

Any idea how I can do this rather thasn having to manage over 30 rules
with each one looking for a single text entry type.

Thanks

Darius

---
frmsrcurl: http://msgroups.net/microsoft.public...heet.functions




Mike H

Using Logical OR on text in Conditional Formatting
 
Hi,

CF rule for is there

=OR(ISNUMBER(SEARCH("Foo",A1)),ISNUMBER(SEARCH("Ba a",A1)))

CF rule for both not there
=AND(NOT(ISNUMBER(SEARCH("Foo",A1))),NOT(ISNUMBER( SEARCH("Baa",A1))))

CF rule for only 1 there

=OR(NOT(ISNUMBER(SEARCH("Foo",A1))),NOT(ISNUMBER(S EARCH("Baa",A1))))

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Darius Poli" wrote:

I have a column with various text entries. I have created a conditional formatting rule for each type of entry but the formatting can be grouped together, so I would like a Conditional Formatting rule that says:

If string contains "foo" or "bar" then colour red
If string does not contain "yibble" or "wibble" then make bold
etc.

Any idea how I can do this rather thasn having to manage over 30 rules with each one looking for a single text entry type.

Thanks

Darius

---
frmsrcurl: http://msgroups.net/microsoft.public...heet.functions
.


Darius Poli

Using Logical OR on text in Conditional Formatting
 
Thanks for the useful hints but I need a little more help I'm afraid.

Column A contains a list of text items and I want to colour them based on the entry, for each entry, so I cannot use references to individual cells.

I tried setting the CF as =OR($A$1:$A$nn="text",...) but that will format things based on the data in the entire column.

What I want to say is, for any cell, if that cell has text "xxx", format one way, if it has text "yyy", format a different way. For a large range of cells with changing values.

Thanks

Darius


---
frmsrcurl: http://msgroups.net/microsoft.public...nal-Formatting

Bob Phillips[_4_]

Using Logical OR on text in Conditional Formatting
 
I think the formula that I gave you will work if you are looking at full
cell content, or Mike's formula if partial cell content. Just select all the
cells at the start.

HTH

Bob

"Darius Poli" / wrote in message
...
Thanks for the useful hints but I need a little more help I'm afraid.

Column A contains a list of text items and I want to colour them based on
the entry, for each entry, so I cannot use references to individual cells.

I tried setting the CF as =OR($A$1:$A$nn="text",...) but that will format
things based on the data in the entire column.

What I want to say is, for any cell, if that cell has text "xxx", format
one way, if it has text "yyy", format a different way. For a large range
of cells with changing values.

Thanks

Darius


---
frmsrcurl:
http://msgroups.net/microsoft.public...nal-Formatting





All times are GMT +1. The time now is 06:31 PM.

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