Conditional Formatting Based on Two Cells in Each Row in WPS Spreadsheets
Question details
Apply one conditional-formatting rule to highlight numeric cells that exceed either of two reference cells in the same row.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- A worksheet has two reference columns and a range of cells to compare against them row by row.
- Observed behavior
- Numeric target cells that exceed at least one numeric reference in their row are highlighted; blank and text values are ignored.
Identify the target range and the two reference columns. The example below formats C1:I50 using columns A and B; adjust the cell references to match your worksheet.
Create a formula-based rule for two row references
Use this rule to highlight numeric target cells that exceed either numeric reference in the same row.
In WPS Spreadsheets, select C1:I50, starting with C1 as the top-left cell.
On the Home tab, open Conditional Formatting, choose New Rule, and select the option to use a formula to determine which cells to format.
In the formula box, enter =AND(ISNUMBER(C1),OR(AND(ISNUMBER($A1),C1>$A1),AND(ISNUMBER($B1),C1>$B1))).
Select Format, choose a fill color or other formatting, and confirm the dialogs to apply the rule.

Compare two row references in WPS Spreadsheets
Use a formula-based conditional-formatting rule in WPS Spreadsheets to highlight numeric values that exceed either reference in the same row.
- 1. Open your worksheet: Open WPS Spreadsheets and select the target range, such as C1:I50.
- 2. Add a formula rule: Choose Home > Conditional Formatting > New Rule, then select the formula-based rule option.
- 3. Enter the formula: Enter =AND(ISNUMBER(C1),OR(AND(ISNUMBER($A1),C1>$A1),AND(ISNUMBER($B1),C1>$B1))) in the formula box.
- 4. Apply formatting: Choose Format, select a highlight style, and confirm the rule.

Frequently Asked Questions
How do I highlight a value only if it exceeds both references?
In the formula-based rule, use =AND(ISNUMBER(C1),ISNUMBER($A1),ISNUMBER($B1),C1>$A1,C1>$B1). This requires both references to be numeric and C1 to exceed both.
What if my target range starts at D2 instead of C1?
Select D2:J50 and use D2 as the target reference. If the reference columns are B and C, use =AND(ISNUMBER(D2),OR(AND(ISNUMBER($B2),D2>$B2),AND(ISNUMBER($C2),D2>$C2))).
Why are there dollar signs before the reference columns?
In $A1 and $B1, the dollar signs keep columns A and B fixed as the rule moves across the selected range. The row numbers remain relative so each row is compared with its own references.
What happens if one reference cell is blank or contains text?
The ISNUMBER check ignores that reference. The target cell can still be highlighted if it exceeds the other reference and that reference is numeric.




