Forum Discussion

captainFlow's avatar
captainFlow
Copper Contributor
Oct 20, 2022

conditional formatting doesn't work with complex "IF" statement

=IF(INDIRECT(ADRESS(ROW();COLUMN()))>1;1;0)
It doen't work, when I put it in the formula for conditional formatting, but for example when I try to separate it and use "INDIRECT(ADRESS(ROW();COLUMN()))>1" or simple "IF" statement like "=IF(ROW()>1;1;1)" (it isn't exactly what I want, it is just for demonstration)

UPD. The formula works fine in google sheets. I have troubles only using excel from microsoft 365.

30 Replies

    • captainFlow's avatar
      captainFlow
      Copper Contributor

      JMB17 

      Hi
      Yes, it really works. I've tryed handle it with 'index' function, but couldn't finish it because of lack of experience. Big thanks :]

      P.S. Getting current cell value via code seems little strange in that way XD;

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    captainFlow 

    This might work. I see you're using semi-colons so I've written the formula using those as the list separator.  I believe the issue with the other formula is the use of ADDRESS.  

    =IF(INDIRECT("RC";0)>1;1;0)

     

    • captainFlow's avatar
      captainFlow
      Copper Contributor
      Yes, I want to highlight all cells for which condition will be true.
      • HansVogelaar's avatar
        HansVogelaar
        MVP

        captainFlow 

        If you want to highlight cells whose value is is a number greater than 1:

        • Select the range that you want to format.
        • In the following, I will assume that A2 is the top left cell of the selection, and that A2 is the active cell in the selection.
        • On the Home tab of the ribbon, click Conditional Formatting > New Rule...

        • Select 'Use a formula to determine which cells to format'.

        • Enter the formula

        =AND(ISNUMBER(A2),A2>1)

        • Click Format...
        • Activate the Fill tab.
        • Select a highlight color.
        • Click OK, then click OK again.

Resources