Home > Software engineering >  How to refer to a current cell in a range when using conditional rules?
How to refer to a current cell in a range when using conditional rules?

Time:01-10

I have a column of cells range(A2:A10) containing a date for the first day of each week. I want the cell color to change when the date is in the past.

When I select the cells I can apply a conditional rule but I can't figure out how to write the formula so it applies to each individual cell.

For example: formula =A2>TODAY() works

However that rule will apply to the whole range returning the result for whether the date value in A2 is in the past.

I want the formula so that the value in A3 is the deciding factor for cell A3, A4 is the deciding factor for A4 etc..

The best way I can explain it would be using "this" in coding when writing the formula.

CodePudding user response:

Select cells you want formatting in. For example A2:A10. When creating rule choose "Format only cells that contains" and in "Format only cells with:" choose "less than" and write =TODAY() formula:

enter image description here

Result: enter image description here

Keep in mind that date format may be different due to settings.

Also tested your formula and it works fine: enter image description here

  • Related