Conditional formating

  • Thread starter Thread starter Brian
  • Start date Start date
Assuming the numbers are integers.

Assume the range of cells is A1:A10
Select the range A1:A10
Goto the menu Format>Conditional Formatting
Condition 1 (even numbers)
Formula Is: =AND(ISNUMBER(A1),MOD(A1,2)=0)
Click the Format button
Select the desired style(s)
OK
Click the Add button
Condition 2 (odd numbers)
Formula Is: =MOD(A1,2)
Click the Format button
Select the desired style(s)
OK out
 
Highlight the cells you want this to apply to (assume A1:A100). Then
with A1 the active cell in this highlighted range, click on Format |
Conditional Formatting and in the panel that pops up choose Formula Is
rather than Cell Value Is in the first box and put this formula in the
next box:

=MOD(A1,2)=0

Then click the Format button, click the Patterns tab (for background
colours) and choose your colour (eg Bright yellow). Click OK once,
then Add another condition in a similar manner with a formula of:

=MOD(A1,2)=1

and this time choose a different colour (eg Red). Click OK twice, and
you should find that even numbers have a yellow background and odd
numbers have red.

Hope this helps.

Pete
 
Back
Top