Conditional formatting of a row if cell value is even

Novice -  
 jeff -
Hello,

In a spreadsheet, my column A gives the record number. It starts at A7.
I would like each row to have a different color based on the number entered in A. If it is even, one color; if it is odd, another color.

Thank you for your help

Configuration: Windows / Chrome 59.0.3071.115

3 answers

  1. Patrice33740 Posted messages 8400 Registration date   Status Member Last intervention   1 784
     
    Hello,

    The MOD() function allows you to detect
    an even number:
    =MOD(A1, 2)=0
    or an odd number
    =MOD(A1, 2)=1

    --
    Best regards
    Patrice
    0
    1. Novice
       
      Thank you Patrice, that completely answered the question!
      I then selected all the relevant cells
      I entered a first condition
      =MOD($A7,2)=0
      then a second one
      =MOD($A7,2)=1
      and it worked wonderfully :)
      Thank you for your help
      0
  2. ccm81 Posted messages 11033 Status Member 2 434
     
    Hello

    1. Color the entire range in "odd color"
    for example A2:A100
    2. Then to get the "even colors" select the range
    3. Ribbon/home tab/icon: conditional formatting
    Choose: new rule
    In the window: "use a formula to determine..."
    =(MOD($A2,2)=0)
    then fill pattern etc ...

    Best regards
    0
    1. jeff
       
      thank you super
      0
  3. mdo100 Posted messages 126 Registration date   Status Member Last intervention   22
     
    Hello everyone,

    If there are no values in column "A", then write this.
    =AND(MOD($A2,2)=0,$A2<>"")

    =AND(MOD($A2,2)=1,$A2<>"")

    Best regards.
    0