How to Apply Conditional Formatting Based on Column Thresholds in Excel
Question details
The user needs to highlight cells in a dataset in different colors (e.g., red or green) based on a dynamic threshold value located at the top of each respective column.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Comparing cell values against a specific threshold in row 4 of the same column to apply color-coded conditional formatting for tracking sales-growth.
- Observed behavior
- The user wants a single formatting rule that dynamically adapts to each column's specific threshold without having to create separate rules for every individual column.
Ensure your dataset is organized in contiguous columns and that the threshold values are consistently located in the same reference row (e.g., row 4) across all the columns you plan to format.
Use a Custom Formula to Determine Which Cells to Format
This is the most flexible method, allowing you to set explicit rules for both above-threshold and below-threshold values using mixed cell references.
By locking only the row reference with a dollar sign (e.g., O$4), the spreadsheet software will dynamically adjust the column reference as it evaluates each cell in your selected range. The formula reference must always align with the active cell of your selection.
Select the range of cells you want to format (for example, O5:S100). Ensure that the upper-left cell (O5) is the active cell in your selection.
Go to Home > Conditional Formatting > New Rule. Choose 'Use a formula to determine which cells to format'.
In the formula bar, type =O5>=O$4. Click Format, choose a green fill color, and click OK.
Repeat the process by creating another New Rule. Enter the formula =O5<O$4, click Format, select a red fill color, and click OK.

Combine Default Fill Color with a 'Cell Value' Rule
A quicker alternative where you manually apply the failure color (red) as the default background fill, then use a simpler conditional rule to overwrite successful cells (green).
Apply Advanced Conditional Formatting Easily in WPS Office
WPS Spreadsheet provides a highly intuitive interface for setting up complex conditional formatting rules, allowing you to highlight data trends and compare thresholds seamlessly.
- 1. Open your dataset in WPS: Launch WPS Spreadsheet and open the document containing your sales or growth data.
- 2. Access Conditional Formatting: Highlight your data range, navigate to the Home tab, and click on the Conditional Formatting icon.
- 3. Configure your custom rule: Select 'New Rule', choose the formula option, enter your mixed reference formula (e.g., =O5>=O$4), and define your color highlights.

Frequently Asked Questions
Why is my conditional formatting highlighting the wrong cells?
This usually happens if the active cell when creating the rule does not match the cell reference used in your formula. Ensure that if you select a range starting from O5, your formula also begins with O5.
How do I lock the row reference but allow the column to change?
You can lock a specific row by placing a dollar sign ($) directly before the row number in your formula, creating a mixed reference like O$4. This keeps the comparison fixed on row 4 as it evaluates across different columns.
Can I automatically apply this formatting rule to new columns added later?
Yes. If you convert your data range into a Table, the conditional formatting rules will automatically expand to include new columns. Alternatively, you can go to Conditional Formatting > Manage Rules and manually update the 'Applies to' range.
Will these rules work if the threshold value is blank?
If the threshold cell is blank, the spreadsheet treats its value as zero. Any positive number in the column will trigger the 'greater than' rule. Ensure your threshold row is completely populated to avoid false highlights.




