Formatting Issues

How to Apply Conditional Formatting to Cells Beside a Middle Cell

Maira MehtabMaira Mehtab Nov 11, 2026 869 views

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.

How to Apply Conditional Formatting to Cells Beside a Middle 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.
Before you start

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.

Solution 1Recommended

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.

1
Select the adjacent cells

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.

2
Open Conditional Formatting

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

3
Choose formula rule

In the dialog box, select the option that says 'Use a formula to determine which cells to format'.

4
Enter the relative formula

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".

5
Set the format and apply

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.

Use a Formula-Based Conditional Formatting Rule
Understanding the Dollar Sign ($): The placement of the dollar sign ($) is crucial. It locks the reference to either the specific column or row, ensuring that the adjacent cells consistently look at the correct middle cell instead of shifting their reference.
WPS Spreadsheet Feature

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. 1. Open the workbook: Launch WPS Spreadsheet and open the document containing your data grid.
  2. 2. Access Conditional Formatting: Select the adjacent cells you wish to color, head to the 'Home' tab, and click 'Conditional Formatting' > 'New Rule'.
  3. 3. Apply the rule: Choose 'Use a formula...', enter your target reference (e.g., =$C3="In progress"), set the color, and click 'OK'.
Intuitive formula builder for advanced conditional formatting rules.Seamlessly compatible with Microsoft Excel (.xlsx) formatting rules.Free, lightweight, and efficient for handling large amounts of data.
microsoft office alternative - wps office

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'.