Forum Discussion

Antoniou_Thanasis's avatar
Antoniou_Thanasis
Copper Contributor
Feb 21, 2023
Solved

Auto Adjust cell color, if previous cell is bigger or smaller number.

Hello,    I want to add colours on the table below automaticaly. I know how to do it using conditional formating. I would like to know if it is possible for the cell to get a color automatically wh...
  • HansVogelaar's avatar
    HansVogelaar
    Feb 21, 2023

    Thanasis_Antoniou 

    Select the cells that you want to format. In the following, I will assume that C3 is the top left cell of the selection, and that it 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

     

    =NOT(AND(ISNUMBER(B3),C3>B3))

     

    Remember, C3 is the active cell, and B3 is the cell to the left of that.

    Click Format...
    Activate the Fill tab.
    Select Green.

     

    Repeat these steps, but with the formula

     

    =AND(ISNUMBER(B3),C3>B3)

     

    and Red.
    Click OK, then click OK again.

Resources