Forum Discussion

TeresaSmags's avatar
TeresaSmags
Copper Contributor
Sep 28, 2022
Solved

If cell(s) have conditional format (fill), then do something, else input value

What formula can I use to look at two columns of data and if any of the columns (one or both) have conditional formatting of color fill, then highlight the cell yellow (or input "Look at!"), else input a value (such as 39)?

 

See attached. I need a formula in column S. It needs to look at both columns K and L; if either of them (or both) have conditional formatting of red fill, then input "Look at!" or, better yet, highlight the column S cell yellow, otherwise input S1 (which is 39).

 

  • mtarler's avatar
    mtarler
    Sep 28, 2022
    most simply maybe:
    =IF(OR(K5>$K$3,AND(L5>0,L5<$L$3)),"Input correct #",$S$1)
    BTW you can do AND and OR using * and +
    =IF((K5>$K$3)+(L5>0)*(L5<$L$3),"Input correct #",$S$1)
  • TeresaSmags's avatar
    TeresaSmags
    Copper Contributor

    The following formula does not work since it's looking at the empty contents in column L and thinking they're zero value!?

    =IF(OR(K5>$K$3,L5<$L$3),"Input correct #",$S$1)

     

    • mtarler's avatar
      mtarler
      Silver Contributor
      most simply maybe:
      =IF(OR(K5>$K$3,AND(L5>0,L5<$L$3)),"Input correct #",$S$1)
      BTW you can do AND and OR using * and +
      =IF((K5>$K$3)+(L5>0)*(L5<$L$3),"Input correct #",$S$1)

Resources