Forum Discussion

Kiddo213lutz's avatar
Kiddo213lutz
Copper Contributor
Feb 16, 2022
Solved

How to format a cell that has a date less than 30 days from another date in a different cell

I would like to have a cell show a color if the date is 30 days less than another date in a different cell.  Form instance, if cell I33 says February 16, 2022 and cell G33 says Feb 22, 2022, how to I get cell I33 to show a color?

 

Thanks

  • Kiddo213lutz 

    Select I33.

    On the Home tab of the ribbon, select Conditional Formatting > New Rule...

    Select 'Format only cells that contain'.

    Leave the first drop down set to 'Cell Value'.

    Select 'greater than' from the second drop down.

    Enter =G33-30 in the box next to it.

    Click Format...

    Activate the Fill tab.

    Select a color.

    Click OK, then click OK again.

9 Replies

  • Kiddo213lutz 

    Select I33.

    On the Home tab of the ribbon, select Conditional Formatting > New Rule...

    Select 'Format only cells that contain'.

    Leave the first drop down set to 'Cell Value'.

    Select 'greater than' from the second drop down.

    Enter =G33-30 in the box next to it.

    Click Format...

    Activate the Fill tab.

    Select a color.

    Click OK, then click OK again.

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        Kiddo213lutz 

        Select the entire range that you want to format conditionally. The active cell should be in the first top) row of the selection. In the following, I will assume that this is row 2.

        On the Home tab of the ribbon, select Conditional Formatting > New Rule...

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

        Enter the following formula in the box:

        =$I2>$G2-30

        Remember, 2 is the row of the active cell - change if the active cell is in another row.

        Click Format...

        Activate the Fill tab.

        Select a color.

        Click OK, then click OK again.

Resources