Function Problems

Conditional Formatting Based on Two Cells in Each Row in WPS Spreadsheets

John WilsonJohn Wilson Dec 2, 2026 869 views

Question details

Apply one conditional-formatting rule to highlight numeric cells that exceed either of two reference cells in the same row.

Conditional Formatting Based on Two Cells in Each Row in WPS Spreadsheets
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target range

In WPS Spreadsheets, select C1:I50, starting with C1 as the top-left cell.

2
Create a new rule

On the Home tab, open Conditional Formatting, choose New Rule, and select the option to use a formula to determine which cells to format.

3
Enter the comparison formula

In the formula box, enter =AND(ISNUMBER(C1),OR(AND(ISNUMBER($A1),C1>$A1),AND(ISNUMBER($B1),C1>$B1))).

4
Choose the highlight

Select Format, choose a fill color or other formatting, and confirm the dialogs to apply the rule.

Create a formula-based rule for two row references
Adjusting the references: C1 must be the top-left cell of the selected range. The dollar signs lock reference columns A and B while the row numbers adjust. The ISNUMBER checks ignore blank and text values, including a text less-than symbol.
Format cells by row

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. 1. Open your worksheet: Open WPS Spreadsheets and select the target range, such as C1:I50.
  2. 2. Add a formula rule: Choose Home > Conditional Formatting > New Rule, then select the formula-based rule option.
  3. 3. Enter the formula: Enter =AND(ISNUMBER(C1),OR(AND(ISNUMBER($A1),C1>$A1),AND(ISNUMBER($B1),C1>$B1))) in the formula box.
  4. 4. Apply formatting: Choose Format, select a highlight style, and confirm the rule.
Compare each target cell with two same-row referencesIgnore blank and text values with ISNUMBER checksOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet menus and formatting tools
microsoft office alternative - wps office

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.