How to Compare Column Groups with Excel Conditional Formatting Formulas
Question details
The user needs to set up a conditional formatting rule to compare cells across different column groups dynamically on a row-by-row basis.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Applying conditional formatting to compare values in a current column with corresponding values in a previous column (e.g., comparing D1 to B1, and F1 to D1) and continuing this pattern down the rows.
- Observed behavior
- When the applied formula does not correctly match the top-left cell of the selected range, Excel highlights incorrect cells across the entire row rather than evaluating each row's comparison correctly.
Identify the exact top-left cell of the range you plan to format. Your conditional formatting formula must be written relative to this specific starting cell for Excel to evaluate the rest of the rows correctly.
Apply a Relative-Reference Formula for Column Comparison
Set up a conditional formatting rule using a relative cell reference (without dollar signs) mapped directly to the top-left cell of your selected target range.
Excel’s 'Manage Rules' interface only displays the formula as it applies to the top-left cell of your selected range. Because the reference is relative, Excel automatically adjusts the row and column references behind the scenes for all other cells in the range.
Highlight the entire range of cells where you want the conditional formatting applied (for example, select cells Y7:Y14).
Navigate to the 'Home' tab on the Excel ribbon, click on 'Conditional Formatting' in the Styles group, and select 'New Rule'.
Choose 'Use a formula to determine which cells to format'. Enter a formula comparing your active top-left cell to the target column (e.g., type =Y7<>W7). Ensure there are no '$' signs anchoring the row.
Click the 'Format' button, choose a fill color or font style to highlight the differences, click 'OK' to confirm the formatting, and then click 'OK' again to apply the rule.

Easily Compare Column Groups with WPS Spreadsheet
WPS Spreadsheet provides intuitive conditional formatting tools that make comparing complex column groups straightforward. Apply relative-reference formulas just like in Excel to automatically highlight data disparities.
- 1. Open Your Dataset: Launch WPS Spreadsheet and open the document containing your column groups.
- 2. Highlight the Target Column: Select the specific cells or column group you want to format (e.g., F1:F100).
- 3. Create a New Rule: Click 'Conditional Formatting' under the 'Home' tab, select 'New Rule', and choose 'Use a formula to determine which cells to format'.
- 4. Enter the Relative Formula: Type your formula relative to the top-left cell (e.g., =F1<>D1), set your preferred fill color, and click 'OK'.

Frequently Asked Questions
Why does my conditional formatting rule highlight the entire column incorrectly?
This typically happens when the formula is not based on the exact top-left cell of your selected 'Applies to' range, or if you accidentally used absolute references (like =$A$1) instead of relative references (like =A1).
Does the 'Manage Rules' window display the conditional formatting formula for every cell?
No. When you view your rule in the Conditional Formatting Rules Manager, the application only displays the formula as it applies to the very first (top-left) cell of your selected range.
How can I compare two adjacent columns and highlight the differences?
Select the second column (e.g., Column B), create a new Conditional Formatting rule using a formula, and type a relative formula comparing it to the first column (like =B1<>A1). Set a fill color to instantly spot any differences row by row.




