How to Apply Conditional Formatting to Cells Beside a Middle Cell
Question details
The user wants to apply specific colors to the cells immediately left and right of a center cell based on the text value (like 'In progress') inside that center cell.

- Product
- Spreadsheets
- Device & OS
- not provided
- Scenario
- Setting up a dynamic visual indicator where adjacent cells change color when the middle cell meets a specific text condition.
- Observed behavior
- A custom formula-based conditional formatting rule needs to be configured with the correct relative references to highlight only the adjacent cells without affecting the entire row.
Identify the exact column or cell that acts as your 'middle cell' trigger and ensure the text condition (such as 'In progress') is typed identically in your formula.
Use a Formula-Based Conditional Formatting Rule
Create a custom rule using mixed references to check the middle cell's value and apply the formatting specifically to the adjacent cells.
By utilizing mixed cell references (like $C3 or C$3 depending on your data structure), you can force your spreadsheet to evaluate the target middle cell before deciding to apply the fill color to the selected adjacent range.
Highlight the specific cells you want to format. This can be the full grid range or just the specific columns to the left and right of your middle cell.
Navigate to the 'Home' tab on the ribbon, click on 'Conditional Formatting', and select 'New Rule'.
In the dialog box, select the option that says 'Use a formula to determine which cells to format'.
Input a formula pointing to your middle cell. For instance, if your middle cell is C3 and you are formatting across the row, enter =$C3="In progress". If the layout evaluates vertically, use =C$3="In progress".
Click the 'Format' button, choose your preferred fill color for the adjacent cells, click 'OK', and then 'OK' again to apply the rule to your selected range.

Easily Manage Conditional Formatting Rules with WPS Office
WPS Spreadsheet provides a highly intuitive interface for setting up, duplicating, and managing complex formula-based conditional formatting rules across extensive datasets.
- 1. Open the workbook: Launch WPS Spreadsheet and open the document containing your data grid.
- 2. Access Conditional Formatting: Select the adjacent cells you wish to color, head to the 'Home' tab, and click 'Conditional Formatting' > 'New Rule'.
- 3. Apply the rule: Choose 'Use a formula...', enter your target reference (e.g., =$C3="In progress"), set the color, and click 'OK'.

Frequently Asked Questions
Why is the conditional formatting applying to the wrong cells?
This typically occurs because the relative or absolute reference in your formula is incorrect. Ensure you have placed the dollar sign ($) correctly to lock the target middle column or row so the surrounding cells reference the right target.
Can I format the entire row based on the middle cell instead of just adjacent cells?
Yes. To do this, highlight your entire data range (including all columns in the row) before opening the Conditional Formatting menu, then use a formula that locks the column containing the condition, such as =$C3="In progress".
How do I edit or delete a conditional formatting rule I already created?
Go to the 'Home' tab, click 'Conditional Formatting', and select 'Manage Rules'. Choose 'This Worksheet' from the dropdown menu to display all rules, select the rule you want to change, and click 'Edit Rule' or 'Delete Rule'.




