Forum Discussion

bailteacher's avatar
bailteacher
Copper Contributor
Apr 18, 2021
Solved

autofill colors based on even or odd numbers

I'm attempting to create a table of names, addresses, ph #'s and email addresses for the courts in Colorado.

There are 64 counties and only 22 judicial districts.

What I want to show is one color for even numbered and a different color for odd judicial districts.

 

3 Replies

  • bailteacher

    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.

    • bailteacher's avatar
      bailteacher
      Copper Contributor

      HansVogelaar 

      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.

       

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        bailteacher 

        Do you use comma as decimal separator? If so, the formula should be

         

        =AND($C2<>"";ISEVEN($C2))

Resources