Conditional Formatting - Multiple Conditions with OR()

E

EEB3

I have been trying to make a conditional format criteria using the "Formula
is", but has not been working quite right.

The formula I have is this:
=NOT(ISERR(OR(SEARCH($A3,"Personnel"),SEARCH($A3,"Ships"))))
and it would effect the cells:
=$AA$3:$AA$6027

What I am trying to do have any cell that is in AA to become Black if the
cell in A does not contain "Ships" or "Personnel". The problem that is
occurring is that with the above Formula none of the cells become black, if I
take away the NOT() in the formula, ALL cells become black. If I take ISERR()
instead of NOT() all cells are not black.

Another similarly problem I have with trying to use with the OR() and trying
to get cells to turn black or not is
=ISERR(OR(NOT(SEARCH($A3,"Personnel"),SEARCH($A3,"Ships"),SEARCH($A3,"Dilemma"),SEARCH($A3,"Event")),SEARCH($I3,"1st"))))
and would effect the cells:
$W$3:$W$6027

In this one, any cell in I with "1st" in it would make W black, or if it
does not contain "Ships", "Personnel", "Event", "Dilemma" it would turn
black. However this one returns various errors. Either stating equivalent to
"Too Complicated" or "Check your formula for errors".

If anyone could help me with trying to get these formulas to work out, I
would appreciate it.

Also something that confounds me at the moment while using the NOT()
statement in a formula is that it is stated that NOT(FALSE)=TRUE,
NOT(TRUE)=FALSE.
Hence, if say a cell in I# = 2nd and I have a Conditional Formula of
=SEARCH($I#,"2nd") to turn J# black, it should equal TRUE. But apparently it
is received as FALSE? And I have to add NOT() to make the condition TRUE?
 
M

Max

EEB3 said:
.. What I am trying to do have any cell that is in AA to become Black
if the cell in A does not contain "Ships" or "Personnel".

One way to get it going is to create a defined range for the 2 words,
then use it in a CF formula via SUMPRODUCT, like this:

Click Insert > Name > Define
Put under "Names in workbook:": MyList
Put in the "Refers to:" box: ={"Ships";"Personnel"}
Click OK

Then select AA3:AA6027 (AA3 active)
apply CF using Formula is:
=SUMPRODUCT(--ISNUMBER(SEARCH(MyList,A3)))=0
Format > Fill color black > OK out

Adapt/extend to suit ..
 
T

T. Valko

any cell that is in AA to become Black if the cell
in A does not contain "Ships" or "Personnel".

Is "Ships" or "Personnel" part of a larger string?

What if the A3 is empty? What do you want to become Black, the text or the
fill color?

Try something like this:

=NOT(OR(A3="personnel",A3="ships"))
 
E

EEB3

Thanks, this helps a lot, Things work now, (as well as cleans up a lot of the
messy formulas I had there.)

And no, "Ships" or "Personnel" would be the only text within that cell
(along with other single worded cells)

And for items that were listed within column A, if it was blank, it would
have no "row" of information after it.

I was having the background of the cell being simply filled black, since
other columns wouldn't require certain cells to be filled based on what
column A had.
 
M

Max

Hold the preceding suggestion if you are looking at the more complex CF
scenario where the 2 words could be part of a text-string in the cells. I had
presumed that was the case, from your original posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top