How to Apply Excel Conditional Formatting to an Entire Row Range
Question details
The user wants to apply a conditional formatting rule across a specific row range (A1:D1) to change the background color when a specific value is entered in one of the cells (D1).
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Highlighting an entire row or specific row range based on a value entered in a single target column.
- Observed behavior
- The standard relative formula (=D1="X") only applies the formatting to the first cell (A1) in the selected range, leaving the rest of the row range unformatted.
Identify the exact range of cells you want to format and note the specific column containing the trigger value before creating your rule.
Use an Absolute Column Reference in the Formula
Lock the column reference using a dollar sign ($) so the formatting rule checks the correct cell for every column in the entire row range.
When applying a formula-based conditional formatting rule to a range, Excel uses relative referencing by default. This means if you write =D1="X" for the range A1:D1, cell A1 looks at D1, but cell B1 looks at E1, C1 looks at F1, and so on. To fix this, you must lock the column reference.
Highlight the entire range of cells you want to format, such as A1:D1.
Navigate to the Home tab, click on Conditional Formatting, and select New Rule.
In the dialog box, select 'Use a formula to determine which cells to format'.
Type the formula =$D1="X". Ensure you place the dollar sign ($) before the column letter D.
Click the Format button, choose your desired fill color (e.g., blue), and click OK to apply the rule.
Create Separate Formatting Rules for Each Column
Apply an individual formatting rule to each column referencing the target cell. This is an alternative workaround if you prefer not to use absolute references.
Highlight Entire Rows Automatically in WPS Spreadsheet
WPS Spreadsheet provides a highly intuitive Conditional Formatting engine that flawlessly handles both absolute and relative referencing, making it simple to highlight entire data ranges based on a single cell's value.
- 1. Select your data: Open your worksheet in WPS Spreadsheet and highlight the row range you want to color (e.g., A1:D1).
- 2. Access Conditional Formatting: Go to the Home tab on the top ribbon and click Conditional Formatting > New Rule.
- 3. Set the formula: Choose 'Use a formula to determine which cells to format' and enter =$D1="X".
- 4. Format and apply: Click the Format button, select your preferred background color, and click OK.

Frequently Asked Questions
Why does my conditional formatting formula only highlight the first cell?
When you use a relative reference like =D1="X" across a range (A1:D1), Excel shifts the reference for each cell. Cell A1 checks D1, but cell B1 checks E1, and C1 checks F1. By locking the column with a dollar sign (=$D1="X"), you force every cell in the row to check column D.
How do I highlight a row if a cell contains specific text rather than an exact match?
You can use the SEARCH function inside your conditional formatting formula. For example, to highlight rows where column D contains the word 'Pending' anywhere in the cell, use the formula =ISNUMBER(SEARCH("Pending",$D1)).
How can I edit a conditional formatting rule I already created?
Select the cells containing the rule, go to the Home tab, click Conditional Formatting, and select 'Manage Rules'. Select your rule from the list and click 'Edit Rule' to modify the formula or the applied format.




