logo
search
Formatting Issues

How to Color Excel Cells Based on Their Last Edited Date

Elise WilliamsElise Williams Oct 15, 2026 869 views

Question details

The user wants to automatically change the background color of Excel cells depending on how recently they were edited, using a color scale like green for within 7 days, orange for 7-30 days, and red for over 30 days.

How to Color Excel Cells Based on Their Last Edited Date
Product
Microsoft Excel
Device & OS
not provided
Scenario
Tracking the freshness of data in a shared workbook hosted on SharePoint by assigning color codes for recent versus old edits.
Observed behavior
Excel does not natively record individual cell edit timestamps through standard formatting. Users must rely on a dedicated date column and correctly formulated conditional formatting rules to achieve the color changes.
Before you start

Since standard spreadsheet software does not automatically store the last edited date as a cell property, ensure you have a dedicated 'Date' column (e.g., Column E) in your worksheet where the last modified date is entered.

Solution 1Recommended

Apply Conditional Formatting Using TODAY() Formulas

Create three separate conditional formatting rules to dynamically change cell colors based on the age of the edit date relative to the current day.

To make cells change color based on elapsed time, you can utilize the TODAY() function within Conditional Formatting. By calculating the difference between the current date and the entered date, the system can determine how many days have passed.

1
Select your target range

Highlight the cells you want to format. For example, select column E starting from cell E2 down to your last row of data.

2
Create a new formatting rule

Navigate to the Home tab on the top ribbon, click on 'Conditional Formatting', and select 'New Rule' from the dropdown menu.

3
Set the Green rule for recent edits (0-7 days)

Choose 'Use a formula to determine which cells to format'. Enter the formula: =AND(TODAY()-E2>=0, TODAY()-E2<=7). Click 'Format', choose a green fill color, and click OK.

4
Set the Orange rule for older edits (8-30 days)

Repeat the 'New Rule' process. Enter the formula: =AND(TODAY()-E2>7, TODAY()-E2<=30). Click 'Format', choose an orange fill color, and click OK.

5
Set the Red rule for oldest edits (Over 30 days)

Create a third rule. Enter the formula: =TODAY()-E2>30. Click 'Format', select a red fill color, and click OK to apply all rules.

Apply Conditional Formatting Using TODAY() Formulas
Relative Cell References: Make sure the cell reference in your formula (e.g., E2) matches the very first cell of your selected range. Do not use absolute references (like $E$2) so the rule can apply dynamically down the column.
Enhance Your Spreadsheets with WPS

Color Cells Automatically with WPS Spreadsheet

WPS Spreadsheet provides robust Conditional Formatting features that are fully compatible with Microsoft Excel formulas. You can easily set up date-based rules to track workbook updates in a lightweight and highly efficient environment.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and open your existing spreadsheet containing the dates.
  2. 2. Highlight the date column: Select the range of cells where you want the color formatting applied.
  3. 3. Access Conditional Formatting: Navigate to the Home tab and click Conditional Formatting > New Rule.
  4. 4. Input the TODAY() logic: Select 'Use a formula...', input your specific TODAY() formulas, and set the green, orange, or red colors.
  5. 5. Apply and track edits: Click OK to apply the formatting. Your spreadsheet will now dynamically update cell colors as days pass.
Seamlessly compatible with Microsoft Excel (.xlsx, .xls) files and conditional formatting rules.Lightweight application with an intuitive, familiar user interface for faster onboarding.Free built-in features for complex formulas like TODAY(), AND(), and custom formatting logic.
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't my conditional formatting rule working for the whole column?

If you select an entire column but write the formula referencing the wrong starting cell (e.g., using E1 instead of E2 when your selection starts at E2), the rule will misalign. Additionally, ensure you do not use absolute references (like $E$1) in the formula, otherwise, the formatting will evaluate based on that single cell for the entire column.

Can Excel automatically detect when a cell was last modified without a formula?

No, standard spreadsheet formulas cannot read the background modification timestamp of individual cells. You must either manually enter the date, use a VBA macro, or utilize SharePoint/Power Automate scripts to record the exact edit time into a designated cell.

Will these conditional formatting rules update dynamically every day?

Yes. Because the formulas use the TODAY() function, the software will recalculate the difference between the current date and the logged cell date every time the workbook is opened or refreshed, automatically shifting colors as time passes.

Can I use zero in the TODAY() formula for same-day edits?

Yes, writing =AND(TODAY()-E2>=0, TODAY()-E2<=7) correctly includes zero, which represents an edit made on the current date. This ensures cells edited on the exact same day will successfully trigger the 0-7 day formatting rule.