If(And for Conditional Formating

R

Ronbo

1. Is it possible to add a "If(And function" to condition(1) in conditional
formating?

2. If so what is the syntax?

What I am using, but does not work (in all cases) is;
If(And(a1>b1),(a1<100))

Using (what I believe to be the correct syntax) is not exceptable:
If(And(a1>b1,a1<100))
 
B

Biff

Hi!

Try this:

=AND(A1>B1,A1<100)

Here's another thing to think about that most people don't consider until
after they discover that it males a difference:

Empty cells!

=AND(A1<>"",B1<>"",A1>B1,A1<100)

Biff
 
R

Ryan Poth

Ronbo,
You need to lose the "if" part of that formula. Conditional format formulae
should always resolve to true/false, so instead try:
=AND(A1>B1,A1<100)

HTH,
Ryan
 
B

bpeltzer

Just use the AND to return TRUE when the condition should be applied...
=and((a1>b1),(a1<100)).
 
W

wjohnson

Try this - The OK and Check can be replaced with any value you want for
the True and False part of the statement.
You might also try a try using an "OR" statement just replace the AND
with OR.

=IF(AND(A2>B2,A2<100),"OK","Check")
 
Top