Extending Conditional Formatting in Google Sheets Using Dynamic Date Calls

Google Sheets, the spreadsheet tool that's part of the Google Apps productivity suite, lets users format cells based on certain conditions, including the date contained in a cell and how far away that date is from the present. For example, if the date is today, the cell background can be shaded red and the text colored white, giving an immediate cue that the task due date is at hand. Tomorrow, that could change automatically to a black background, indicating the task is past due.

Google sheets conditional formatting date options
Google sheets conditional formatting date options
Yesterday and today: Conditional formatting lets users assign text and background colors based on relative dates.

But the options available through the Conditional Formatting dialog are limited. The default options include today, tomorrow, yesterday and "exact date," along with the less useful options of "in the past week," "in the past month" and "in the past year."

Google sheets conditional formatting date options
Default conditional formatting options in Google Sheets

That doesn't give a lot of options for providing visual cues about date-based information, such as how far in the future a particular assignment might be due.

But there is, in fact, a workaround for this that will allow you to assign text and background colors based on any date in the future that you choose to assign — eight days from now, 21 days from now, whatever. You just have to borrow a simple formula commonly used in other spreadsheets.

It works like this:

1. Select your entire column or the range of cells to which you want to apply the formatting, then choose Format > Conditional Formatting. In my case, I will choose the "Due Date" column in my assignment spreadsheet for a hypothetical H.P. Lovecraft seminar (since I happen to be wearing my Miskatonic U sweatshirt as I write this).

 Google sheets conditional formatting date options

2. Click the "+Add Another Rule" button.

 google docs spreadsheet conditional formatting add rule

3. In the pull-down menu, instead of choosing "Date Is," choose "Is Equal to."

4. Then enter the following formula:

=TODAY() +3

That indicates a date that is three days in the future from the present (whatever the present date happens to be when the user is viewing the spreadsheet).

 Google sheets conditional formatting date options

Repeat that step for all of the possible dates that you want to format. For four days hence, use

=TODAY() +4

For five days hence, use

=TODAY() +5

Et cetera.

5. Apply the text and background colors of your choosing to all of the options you've created. I will set mine to become progressively cooler (greens and blues) the further the due date is in the future and warmer (yellows and reds) as the due date nears.

 Google sheets conditional formatting date options

Click the Save button, and voila!

 Google sheets conditional formatting date options

You wind up with a very colorful spreadsheet with immediately identifiable date cues.

Next time: conditional formatting based on ranges.

About the Author

David Nagel is the former editorial director of 1105 Media's Education Group and editor-in-chief of THE Journal, STEAM Universe, and Spaces4Learning. A 30-year publishing veteran, Nagel has led or contributed to dozens of technology, art, marketing, media, and business publications.

He can be reached at [email protected]. You can also connect with him on LinkedIn at https://www.linkedin.com/in/davidrnagel/ .


Featured

  • computer with a red warning icon on its screen, surrounded by digital grids, glowing neural network patterns, and a holographic brain

    Report Highlights Security Risks of Open Source AI

    In these days of rampant ransomware and other cybersecurity exploits, security is paramount to both proprietary and open source AI approaches — and here the open source movement might be susceptible to some inherent drawbacks, such as use of possibly insecure code from unknown sources.

  • Two shadowy figures sit at computers with glowing screens, surrounded by floating digital codes in a dark, high-tech environment

    Reports Note Increasing Threat of Nation-State-Sponsored Cyber Attacks

    A bevy of new cybersecurity reports point to the continuing problem of nation-state-sponsored threat actors. The primary culprits have long been Russia, China, Iran, and North Korea, which all show up in recently published reports from Microsoft, IBM, Tenable, and Fortinet.

  • man working on laptop outdoors

    Digital Leadership Must-Haves for 2025: A CDO's Picks

    Now that he's more than a year and a half into his chief digital officer role at NJIT, we've asked Ed Wozencroft to reflect on his areas of concentration: What work must digital leaders "own" in 2025?

  • interconnected cubes and circles arranged in a grid-like structure

    Hugging Face Gradio 5 Offers AI-Powered App Creation and Enhanced Security

    Hugging Face has released version 5 of its Gradio open source platform for building machine learning (ML) applications. The update introduces a suite of features focused on expanding access to AI, including a novel AI-powered app creation tool, enhanced web development capabilities, and bolstered security measures.