Formatting Issues

Highlight Excel Cells That Match Lists on Another Worksheet

Natalie TaylorNatalie Taylor Dec 2, 2026 869 views

Question details

Highlight values on a scanning worksheet when they match an item in either of two lists on another worksheet.

Highlight Excel Cells That Match 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.
Before you start

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.

Solution 1Recommended

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.

1
Name the model list

On the List of Things to Keep sheet, select A2:A1000. Go to Formulas > Define Name, enter ModelNames, and set the scope to Workbook.

2
Name the part number list

Select B2:B1000, then use Formulas > Define Name to create a workbook-scoped name called PartNumbers.

3
Select scanned cells

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.

4
Create the formula 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)).

5
Choose the highlight

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.

Use named ranges in an Excel conditional formatting rule
Include new list entries: The named ranges only cover the cells you selected. Use Formulas > Name Manager to expand them if your lists grow beyond row 1000.
Try it in WPS Office

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. 1. Open the workbook: Open the Excel workbook in WPS Spreadsheet and locate the scanning sheet and the worksheet containing both lists.
  2. 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. 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. 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.
Highlight matches against model names or part numbersOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and formatting toolsWork with a free, easy-to-use office suite
microsoft office alternative - wps office

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.