Highlight Excel Cells When IDs Match a Separate List
Question details
Highlight values in column A only when they also appear in a separate ID list in column B.

- 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.
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.
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.
In the worksheet, select A2:A20. Adjust the range if your IDs occupy different rows.
Go to Home > Conditional Formatting > New Rule, then select Use a formula to determine which cells to format.
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.
Select Format, choose a color on the Fill tab, and click OK. Click OK again to apply the rule.

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. Open the worksheet: Open WPS Spreadsheet and use Open to select your spreadsheet file.
- 2. Select the IDs: Select the cells to check, such as A2:A20, without selecting the header.
- 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. Apply a fill color: Choose a fill color in the rule's formatting options, then confirm the rule to highlight matching cells.

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.




