How to address the current cell in conditional format custom formula?

Google SheetsGs Conditional-Formatting

Google Sheets Problem Overview


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

Google Sheets Solutions


Solution 1 - Google Sheets

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

Solution 2 - Google Sheets

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.

Solution 3 - Google Sheets

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.

Solution 4 - Google Sheets

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.

Solution 5 - Google Sheets

Try apply to range:

A3:M10

Custom formula is:

=$2:$2=TODAY()

Solution 6 - Google Sheets

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVladimir MikhaylovskiyView Question on Stackoverflow
Solution 1 - Google SheetsAprillionView Answer on Stackoverflow
Solution 2 - Google SheetsStanislav PankevichView Answer on Stackoverflow
Solution 3 - Google SheetsMarkus Amalthea MagnusonView Answer on Stackoverflow
Solution 4 - Google SheetsVladimir MikhaylovskiyView Answer on Stackoverflow
Solution 5 - Google SheetsEd NelsonView Answer on Stackoverflow
Solution 6 - Google SheetsDragasView Answer on Stackoverflow