90

I need to write a conditional format rule with a custom formula, that should trigger when the certain cell's (the cell in the 3rd row of the column of the current cell) value is "TODAY()", and the current cell is empty. I know how to check the other cell, but is there a way to check the current cell's value in the same rule?

As you can see on this image, one column has a different color because the 3rd row of the column of the current cell contains the current date. And only empty cells are colored.

Here is my rule:

=and($3:$3=TODAY(), ????)

It should apply to all cells in a range A4:M10

I need it to be the one rule, not combination of multiple rules. I need to put something to the place of ????

In other words, I need to place the value described as "Cell is empty" in the custom formula as it's part.

Here is an example spreadsheet: https://docs.google.com/spreadsheets/d/1vpNrX2aUg8vY5WGDDuBnLfPuL-UyrjFvzjdATS73aq8/edit?usp=sharing

Rubén
  • 34,714
  • 9
  • 70
  • 166
Vladimir Mikhaylovskiy
  • 1,955
  • 4
  • 19
  • 28

6 Answers6

90

The current cell is addressed by the first cell of a range in the conditional formatting. In your example, the range is A4:M10 and therefore you can use A4 as "current cell".

  • Check for empty content:

    =A4=""
    


Relative vs absolute references in conditional formatting work just like copying a formula.
  • Check that the cell in 2nd row of current column row is today:

    =A$2=TODAY()
    
  • Combine using AND operator:

    =AND(A$2=TODAY(), A4="")
    

I have updated a copy of your example spreadsheet - https://docs.google.com/spreadsheets/d/1MY9Jn2xpoVoBeJOa2rkZgv5HXKyQ9I8SM3kiUPR9oXU/edit#gid=0

Aprillion
  • 21,510
  • 5
  • 55
  • 89
  • 1
    Your google sheet has no read access to the conditional formatting. So I cannot see the formulas :( – moobi May 02 '23 at 08:44
  • @moobi no idea how to add permission for people to view it directly, please download the file and/or copy it to your own google drive – Aprillion May 03 '23 at 09:07
59

If I want to check if current cell is empty this is working for me:

=ISBLANK(INDIRECT(ADDRESS(ROW(),COLUMN())))

The cell at the previous row in the column will be

=ISBLANK(INDIRECT(ADDRESS(ROW() - 1,COLUMN()))) etc.

Kos
  • 4,890
  • 9
  • 38
  • 42
Stanislav Pankevich
  • 11,044
  • 8
  • 69
  • 129
40

This is the shortest possible way I've found to reference the current cell in conditional formatting spanning a range:

INDIRECT("RC",FALSE).

Documentation is here.

Kos
  • 4,890
  • 9
  • 38
  • 42
Markus Amalthea Magnuson
  • 8,415
  • 4
  • 41
  • 49
  • 4
    This looks like the most elegant way to use "this cell" in conditional formatting, I like it. However I cannot find anywhere that says using "RC" without any numbers will do what you predict. *It works* but I don't see it in documentation, including the document to which you link here! What made you even attempt it? – jay613 Aug 29 '19 at 19:03
  • 3
    I can't remember anymore and R1C1 is ancient in origin so I haven't found any formal specification. I probably found it while searching the web, here's an example of an article that mentions the "RC" method: https://powerspreadsheets.com/r1c1-formular1c1-vba/ ['…Finally, if you're referring to the cell itself (creating a circular reference), the first portion of the cell reference is simply “R”…'] – Markus Amalthea Magnuson Oct 27 '19 at 16:30
6

Ok, I found the answer myself. The correct complete formula is:

=and($2:$2=TODAY(),INDIRECT("R"&ROW()&"C"&COLUMN(),FALSE)="")

This rule:

INDIRECT("R"&ROW()&"C"&COLUMN(),FALSE)=""

checks if the current cell is empty.

Vladimir Mikhaylovskiy
  • 1,955
  • 4
  • 19
  • 28
0

Try apply to range:

A3:M10

Custom formula is:

=$2:$2=TODAY()
Kos
  • 4,890
  • 9
  • 38
  • 42
Ed Nelson
  • 10,015
  • 2
  • 27
  • 29
0

In your custom function rewrite the original conditional formatting range. The spreadsheet application will then take the current cell. As a result, your formula will be something like this

=function(A4:M10)

Apply transformations as necessary to make the result truthy/falsy.

Dragas
  • 1,140
  • 13
  • 29