Forum Discussion
autofill colors based on even or odd numbers
- Apr 20, 2021
Do you use comma as decimal separator? If so, the formula should be
=AND($C2<>"";ISEVEN($C2))
Let's say the judicial district numbers are in column C, starting in C2.
Select row 2 to however far down you want to go. The active cell in the selection should be in row 2.
On the Home tab of the ribbon, select Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula =AND($C2<>"",ISEVEN($C2))
Click Format...
Activate the Fill tab.
Select a color, then click OK twice.
Repeat the above steps with the formula =ISODD($C2) and another color.
Thanks for the reply.
However when I place highlight the cells from C2 down to C72 and then selecting the Conditional Formatting > New Rule then select 'Use a formula to determine which cells to format' and then enter the formula you sent:
=AND($C2<>"",ISEVEN($C2))
I then click Format and select the color & click OK twice (can't click the OK for the color twice).
After clicking the OK for the color an error msg comes up indicating EXCEL thinks I'm trying to create a formula and I need to place an apostrophe before the = so EXCEL doesn't get confused.
I hit the OK button for the error msg and nothing happens.
I don't understand what I'm doing wrong.
- HansVogelaarApr 20, 2021MVP
Do you use comma as decimal separator? If so, the formula should be
=AND($C2<>"";ISEVEN($C2))