Forum Discussion

CWsChim's avatar
CWsChim
Copper Contributor
May 25, 2023
Solved

Conditional Formatting

Is it possible to utilize conditional formatting rules on a cell range where the values are being calculated with formulas?

  • CWsChim 

    Problem #1: The formula in C2:C15

     

    =IF(B2<B23,"1",IF(AND(B2>=B23,B2<C23),"2",IF(AND(B2>=C23,B2<D23),"3",IF(AND(B2>=D23,B2<E23),"4",IF(B2>E23,"5")))))

     

    returns text values, not numbers, because you enclose 1 etc. in quotes: "1". Change it it to

     

    =IF(B2<B23,1,IF(AND(B2>=B23,B2<C23),2,IF(AND(B2>=C23,B2<D23),3,IF(AND(B2>=D23,B2<E23),4,IF(B2>E23,5)))))

     

    Many of the conditions are superfluous, you can shorten the formula to

     

    =IF(B2<B23,1,IF(B2<C23,2,IF(B2<D23,3,IF(B2<E23,4,5))))

     

    Problem #2: the conditional formatting formula should be

     

    =$C2=5

     

    and similar for the other values. See the attached version (I used a different color for 2, but you can change that).

      • CWsChim 

        Problem #1: The formula in C2:C15

         

        =IF(B2<B23,"1",IF(AND(B2>=B23,B2<C23),"2",IF(AND(B2>=C23,B2<D23),"3",IF(AND(B2>=D23,B2<E23),"4",IF(B2>E23,"5")))))

         

        returns text values, not numbers, because you enclose 1 etc. in quotes: "1". Change it it to

         

        =IF(B2<B23,1,IF(AND(B2>=B23,B2<C23),2,IF(AND(B2>=C23,B2<D23),3,IF(AND(B2>=D23,B2<E23),4,IF(B2>E23,5)))))

         

        Many of the conditions are superfluous, you can shorten the formula to

         

        =IF(B2<B23,1,IF(B2<C23,2,IF(B2<D23,3,IF(B2<E23,4,5))))

         

        Problem #2: the conditional formatting formula should be

         

        =$C2=5

         

        and similar for the other values. See the attached version (I used a different color for 2, but you can change that).

Resources