Forum Discussion

johnnyschiele1's avatar
johnnyschiele1
Copper Contributor
Jan 02, 2019
Solved

Formatting Excel cells

Not sure if I'm explaining this correctly, but I would like to format cells to change to RED if the value is within 500 miles of another cell.     In the sample pic attached, if cells N2, P2, R2, o...
  • SergeiBaklan's avatar
    SergeiBaklan
    Jan 02, 2019

    Let me explain on your sample. First, select your range and under Conditional formatting select New rule like this

    The rule is triggering applied format if the formula for it returns TRUE and ignores the formatting otherwise

    First part of the formula returns TRUE if any the value of the any cell in the range is less than 500 from the value of the correspondent cell in column J

    =(ABS(N2-$J2)<=500)

    (please be care about absolute and relative references). But you don't need to apply format for the columns O, Q, etc. Second part of the formula returns TRUE if your cell is within every even column (N, P, etc)

    =ISEVEN(COLUMN(N2))

    Multiplication of both part is equivalent of AND condition, thus entire formula triggers formatting (other words returns TRUE) if both your cell is in even column and the value of the cell is differ from  the value of the correspondent cell in column J on not more than 500.

     

    How it works is in attached file.

Resources