Formatting Issues

How to Highlight Yearly Maximum Values with Dynamic Conditional Formatting in Excel

Phi Hung VoPhi Hung Vo Nov 11, 2026 869 views

Question details

The user wants to create a conditional formatting rule that automatically highlights the maximum value for each year in a dataset where new daily rows are continuously added.

How to Dynamically Highlight Yearly Maximum Values in Excel
Product
Excel
Device & OS
not provided
Scenario
Maintaining a growing dataset with daily entries and needing the highest value of each year to be highlighted without manually adjusting the formatting range every time new data is pasted or typed.
Observed behavior
Setting up a dynamic formula-based conditional formatting rule that adapts to expanding rows while correctly calculating the yearly maximums.
Before you start

Ensure your data is organized with dates in one continuous column and the numerical values you want to evaluate in another. Verify that your date column contains valid date serial numbers, not just text strings that look like dates, to prevent formula calculation errors.

Solution 1Recommended

Use an Excel Table for Automatic Range Expansion

Converting your data into a structured Excel Table is the most reliable method, as it automatically expands conditional formatting ranges and named references when new data is added.

When dealing with continuously growing datasets, standard ranges can be problematic because conditional formatting rules may not expand consistently. Excel Tables solve this by automatically absorbing new rows into the table's structure, ensuring any applied formatting rules scale dynamically.

1
Convert data to a Table

Select any cell within your dataset and press Ctrl+T (or go to Insert > Table). Ensure 'My table has headers' is checked and click OK.

2
Create a new formatting rule

Select the data rows in your new Table. Go to the Home tab on the ribbon, click Conditional Formatting, and choose New Rule.

3
Enter the array formula

Choose 'Use a formula to determine which cells to format'. Enter the conditional formatting formula adapting to your columns. For example, if dates are in column A and values in column E: =($E2=MAX(IF(YEAR($A2)=YEAR($A$2:$A$10000),$E$2:$E$10000,"")))

4
Apply formatting

Click the Format button, select a fill color (like yellow or green) to highlight the maximum value, and click OK twice to apply the rule.

Use an Excel Table for Automatic Range Expansion
Automatic Expansion: Now, whenever you add a new daily row at the bottom, the Excel Table will expand automatically, bringing the conditional formatting rule with it without requiring manual updates.
Efficient Data Analysis with WPS Office

Easily Manage Dynamic Conditional Formatting with WPS Spreadsheet

WPS Spreadsheet provides robust support for advanced array formulas, structured tables, and conditional formatting just like Microsoft Excel. It's a powerful, free tool that makes managing growing daily datasets and complex analytical formatting a breeze.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open your existing Excel (.xlsx) workbook containing the daily data.
  2. 2. Format as Table: Select your dataset and press Ctrl+T to quickly convert it into a structured Table.
  3. 3. Apply Conditional Formatting: Go to the Home tab, click Conditional Formatting > New Rule, and paste your dynamic MAX formula to highlight yearly peaks.
Fully compatible with Microsoft Excel (.xlsx) formulas, including complex arrays.Built-in structured tables for seamless, automatic data expansion.Advanced conditional formatting rules with an intuitive, familiar interface.Lightweight and fast performance even when handling large daily datasets.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my conditional formatting range not expanding when I add new rows?

This usually happens when applying formatting to a standard data range instead of a structured Table. Excel may not automatically update the 'Applies to' range of the conditional formatting rule when you paste or type below the last row. Converting your data to a Table by pressing Ctrl+T resolves this issue by automatically extending formatting to new rows.

Can I use MAXIFS instead of the MAX(IF(...)) array formula?

Yes. If you are using a newer version of Excel or WPS Office, you can simplify the logic and avoid array formulas using MAXIFS. The equivalent formula would be: =$E2=MAXIFS($E:$E, $A:$A, ">="&DATE(YEAR($A2),1,1), $A:$A, "<="&DATE(YEAR($A2),12,31)). This approach often performs faster on large datasets.

Why does my conditional formatting highlight blank cells at the bottom of the range?

If you applied the rule to a large fixed range (e.g., rows 2 to 10000) that includes empty rows, the formula might evaluate those blanks as zeroes or return unexpected true matches. To fix this, you must append a condition to verify the cell isn't blank. In a formula, you can multiply your main logic by ($A2<>"") so that empty rows are forced to evaluate as false.