Highlight Excel Cells That Match Lists on Another Worksheet
Question details
Highlight values on a scanning worksheet when they match an item in either of two lists on another worksheet.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A scanning sheet contains values to check against model names and part numbers stored on a separate worksheet.
- Observed behavior
- Matching scanned values should be highlighted automatically using conditional formatting.
Identify the scanning range and the columns containing model names and part numbers. The example below assumes scanned values start in A2 and the two lists occupy A2:A1000 and B2:B1000 on a worksheet named List of Things to Keep.
Use named ranges in an Excel conditional formatting rule
Create named ranges for the two lists, then use a formula to highlight matches on the scanning sheet.
On the List of Things to Keep sheet, select A2:A1000. Go to Formulas > Define Name, enter ModelNames, and set the scope to Workbook.
Select B2:B1000, then use Formulas > Define Name to create a workbook-scoped name called PartNumbers.
Open the scanning sheet and select the cells to check, such as A2:A1000. Make sure A2 is the active cell when you create the rule.
Choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. Enter =AND(A2<>"",OR(COUNTIF(ModelNames,A2)>0,COUNTIF(PartNumbers,A2)>0)).
Select Format, choose a fill color, and click OK to save the rule. Change A2 in the formula to the active cell of your selected range if your selection starts elsewhere.

Highlight matching list values in WPS Spreadsheet
Use named ranges and a conditional formatting formula in WPS Spreadsheet to highlight scanned values found in either list.
- 1. Open the workbook: Open the Excel workbook in WPS Spreadsheet and locate the scanning sheet and the worksheet containing both lists.
- 2. Define the list names: Select the model name cells and use Formulas > Define Name to name them ModelNames. Repeat for the part number cells using the name PartNumbers.
- 3. Select the scanning range: On the scanning sheet, select the cells to check, such as A2:A1000, with A2 as the active cell.
- 4. Add the formatting rule: Choose Home > Conditional Formatting > New Rule and select the formula-based rule. Enter =AND(A2<>"",OR(COUNTIF(ModelNames,A2)>0,COUNTIF(PartNumbers,A2)>0)), choose a fill color, and confirm. Replace A2 with the active cell if your range starts elsewhere.

Frequently Asked Questions
Why use named ranges for lists on another worksheet?
Named ranges let the conditional formatting formula refer to cells on another sheet without relying on a direct sheet reference. In Excel, create or edit them under Formulas > Define Name or Name Manager.
How do I keep blank scanning cells from being highlighted?
Include A2<>"" in the AND portion of the rule, replacing A2 with the active cell of your selected scanning range.
What happens when I add items below the named list ranges?
Items outside the named ranges are not checked. In Excel, open Formulas > Name Manager and extend ModelNames or PartNumbers to include the new cells.
Does COUNTIF distinguish uppercase and lowercase text?
No. COUNTIF matches text without case sensitivity. It also treats an asterisk and question mark in the criteria as wildcard characters.




