Highlight Excel Rows When Values Match Another Column
Question details
Highlight a cell or an entire row when its value appears in another column.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Compare values in column D with values in column F and highlight matching rows or cells.
- Observed behavior
- Conditional formatting should highlight the row containing the matching value rather than an adjacent row.
Identify the column to check, the column containing the comparison values, and the first row of the range you want to format. The examples below assume data starts in row 2 and runs through row 100.
Create a conditional formatting rule with MATCH
Use a formula-based rule to highlight each row where its column D value appears anywhere in column F.
Select A2:F100 to highlight entire rows, or select D2:D100 to highlight only the matching cells in column D.
Go to Home > Conditional Formatting > New Rule, then select Use a formula to determine which cells to format.
Enter =ISNUMBER(MATCH($D2,$F$2:$F$100,0)). The $D2 reference checks column D in each row, while the fixed F range contains the values to match.
Click Format, choose a fill color, and click OK. Click OK again to apply the rule.

Highlight matching rows in WPS Spreadsheet
Use a formula-based conditional formatting rule in WPS Spreadsheet to compare values in two columns and highlight matching rows.
- 1. Open your spreadsheet: Open WPS Spreadsheet and use File > Open to select your workbook.
- 2. Select the rows: Select A2:F100 to format the rows containing the values to compare.
- 3. Add a formula rule: Go to Home > Conditional Formatting > New Rule and choose the option to use a formula. Enter =ISNUMBER(MATCH($D2,$F$2:$F$100,0)).
- 4. Apply a format: Choose a fill color in the formatting settings and confirm the rule. Check that matches in column D highlight the intended rows.

Frequently Asked Questions
Why is Excel highlighting the row next to the match?
The formula's starting row may not match the first row of the selected range. Under Home > Conditional Formatting > Manage Rules, check the Applies to range and make sure the formula uses $D2 if that range starts on row 2.
How do I highlight only the matching cells instead of whole rows?
Select D2:D100 before creating the rule, then use =ISNUMBER(MATCH($D2,$F$2:$F$100,0)) in the formula-based conditional formatting rule.
How can I highlight values in column F that also appear in column D?
Select F2:F100 and create a formula-based conditional formatting rule using =ISNUMBER(MATCH($F2,$D$2:$D$100,0)).
How do I prevent blank cells from being highlighted?
Add a nonblank test to the rule. For a range starting on row 2, use =AND($D2<>"",ISNUMBER(MATCH($D2,$F$2:$F$100,0))).




