Formatting Issues

Highlight Excel Cells When IDs Match a Separate List

Emma BrownEmma Brown Nov 18, 2026 869 views

Question details

Highlight values in column A only when they also appear in a separate ID list in column B.

Highlight Excel Cells When IDs Match a Separate List
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains IDs to check in column A and a reference list of IDs in column B.
Observed behavior
Only column A cells whose IDs appear in the column B list should be highlighted; duplicates within column A alone should not trigger highlighting.
Before you start

Identify the cells to check and the range containing the reference IDs. The example uses A2:A20 for the values and B2:B20 for the list, with row 1 reserved for headers.

Solution 1Recommended

Use a MATCH Formula in Excel Conditional Formatting

Create a rule that highlights each cell in column A if its value exists in the column B ID list.

MATCH searches the reference list for an exact match, and ISNUMBER returns TRUE when a match is found. The fixed B2:B20 reference keeps the same lookup list for every cell.

1
Select the target cells

In the worksheet, select A2:A20. Adjust the range if your IDs occupy different rows.

2
Create a formula rule

Go to Home > Conditional Formatting > New Rule, then select Use a formula to determine which cells to format.

3
Enter the matching formula

In the formula box, enter =ISNUMBER(MATCH($A2,$B$2:$B$20,0)). If your selection starts on another row, replace 2 in $A2 with that starting row number.

4
Choose the highlight

Select Format, choose a color on the Fill tab, and click OK. Click OK again to apply the rule.

Use a MATCH Formula in Excel Conditional Formatting
Highlight entire rows: To highlight additional columns in each matching row, select the full target range, such as A2:D20, before creating the rule. Keep $A2 in the formula so the rule checks column A.
WPS Spreadsheet

Highlight Matching IDs in WPS Spreadsheet

Use a formula-based conditional formatting rule in WPS Spreadsheet to compare column A with an ID list in column B and highlight matches.

  1. 1. Open the worksheet: Open WPS Spreadsheet and use Open to select your spreadsheet file.
  2. 2. Select the IDs: Select the cells to check, such as A2:A20, without selecting the header.
  3. 3. Add the formula: Go to Home > Conditional Formatting > New Rule and choose the formula-based rule option. Enter =ISNUMBER(MATCH($A2,$B$2:$B$20,0)).
  4. 4. Apply a fill color: Choose a fill color in the rule's formatting options, then confirm the rule to highlight matching cells.
Highlight IDs based on a separate reference listOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and formatting toolsWork with spreadsheets in a free Office suite
microsoft office alternative - wps office

Frequently Asked Questions

Will duplicates in column A be highlighted if they are not in column B?

No. The MATCH formula checks each value in column A against the specified column B list, not against other values in column A.

How can I highlight the whole row instead of just column A?

Select the full range to format, such as A2:D20, before creating the rule. Use =ISNUMBER(MATCH($A2,$B$2:$B$20,0)) so each row is checked using its column A value.

How do I exclude blank cells from highlighting?

Use =AND($A2<>"",ISNUMBER(MATCH($A2,$B$2:$B$20,0))) in the conditional formatting rule. This requires the column A cell to be nonblank as well as present in the list.

What if the ID list extends beyond B20?

Edit the rule under Home > Conditional Formatting > Manage Rules and expand the lookup range in the formula, for example from $B$2:$B$20 to $B$2:$B$100.