How to Use Conditional Formatting to Color Cells Beside Specific Text in WPS Spreadsheet
Question details
The user needs to dynamically format and color cells to the right of any cell containing the text "DATE", while simultaneously removing specific cell borders.

- Product
- WPS Spreadsheet
- Device & OS
- not provided
- Scenario
- Setting up a dynamic worksheet where the background color and borders of adjacent cells change automatically when a trigger keyword is entered in a specific column.
- Observed behavior
- The user wants the adjacent cells in the row to update their fill color and clear existing borders automatically upon detecting the word "DATE" in the target cell.
Before applying new formatting rules, it is highly recommended to select your target range and clear any existing conditional formatting to prevent conflicting rules from overriding your new settings.
Apply Conditional Formatting Using a Custom Formula
Use a formula within the conditional formatting rules to evaluate a target cell and apply color fills and border changes to the adjacent cells.
By utilizing an absolute column reference in a custom formula, you can force the entire selected row or adjacent columns to format themselves based on the value found in a single specific column.
Highlight the range of cells you want to format. For example, select A1:E1 or a larger data range like A1:E100 where column A contains the trigger text.
Navigate to the Home tab on the top ribbon, click on Conditional Formatting, and select New Rule from the dropdown list.
Choose the option 'Use a formula to determine which cells to format'. In the formula box, enter =$A1="DATE". The dollar sign ensures the rule strictly evaluates column A.
Click the Format button. Go to the Fill tab to choose your desired interior background color. Then, switch to the Border tab to remove the left, right, top, or bottom borders as needed. Click OK to save.

Automate Formatting Using VBA Code
If your worksheet already relies on macros, you can use a VBA script to find specific text and modify the adjacent cells' interior color and borders.
Easily Highlight and Format Cells with WPS Spreadsheet
WPS Spreadsheet provides powerful, intuitive conditional formatting tools that make dynamic data visualization simple, allowing you to highlight adjacent cells seamlessly without complex programming.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing the data you want to format.
- 2. Select the data area: Click and drag to highlight the specific rows and columns that require dynamic coloring.
- 3. Apply the rule: Go to Home > Conditional Formatting to quickly input your formula and select your cell styles.

Frequently Asked Questions
Why is only the cell with the word "DATE" changing color, but not the cells beside it?
This happens when the absolute reference is missing in your formula. Ensure you include a dollar sign before the column letter (e.g., =$A1="DATE"). This locks the evaluation to column A, allowing the formatting rule to apply to the adjacent columns in the selected range.
How do I clear conflicting conditional formatting rules?
Highlight your data range, navigate to the Home tab, click on Conditional Formatting, select Clear Rules, and choose 'Clear Rules from Selected Cells'. This removes old formatting before you apply the new formula.
Can I format cells based on partial text matches instead of exact words?
Yes. Instead of using an exact match formula, you can use the SEARCH function. For example, using the formula =ISNUMBER(SEARCH("DATE",$A1)) will format the row if the word 'DATE' appears anywhere inside the target cell.




