logo
search
Formatting Issues

How to Highlight Excel Cells in Workbook A Based on Workbook B

Tauseeq MagsiTauseeq Magsi Sep 25, 2026 868 views

Question details

The user needs to highlight matching items in multiple daily worksheets (Workbook A) whenever those items appear in a frequently updated reference list in a separate file (Workbook B).

How to Highlight Excel Cells in Workbook A Based on Workbook B
Product
Excel
Device & OS
not provided
Scenario
Comparing and matching data across two different workbooks, where one workbook acts as a dynamic master list and the other contains daily transactional records spread across multiple sheet tabs.
Observed behavior
The user wants the formatting in Workbook A to automatically update when the reference list in Workbook B changes, without needing to recreate formatting rules on every daily sheet.
Before you start

Ensure both Workbook A and Workbook B are open in your spreadsheet application, as conditional formatting rules utilizing cross-workbook formulas often require the source file to be actively open to update successfully.

Solution 1Recommended

Apply Conditional Formatting Using COUNTIF

Use the COUNTIF function in a conditional formatting rule to highlight matching values in Workbook A directly referencing the list in Workbook B.

By applying a formula-based conditional formatting rule, you can check if a cell's value exists in an external workbook. Grouping your daily sheets allows you to apply this rule across all of them at once.

1
Group the Daily Worksheets

In Workbook A, hold the 'Shift' key and click the first and last daily worksheet tabs. This groups the sheets so any formatting applied will affect all of them simultaneously.

2
Select the Target Range

Highlight the range of cells where you want the conditional formatting to apply (e.g., A1:A100).

3
Create a New Formatting Rule

Navigate to the 'Home' tab, click on 'Conditional Formatting', and select 'New Rule'. Choose 'Use a formula to determine which cells to format'.

4
Enter the External Reference Formula

In the formula box, input =COUNTIF('[Workbook B.xlsx]Sheet1'!$A$1:$A$100, A1)>0. Adjust the file name, sheet name, and ranges to match your exact setup.

5
Set the Highlight Color

Click 'Format', choose a fill color to highlight the matching items, and click 'OK' to apply the rule.

Apply Conditional Formatting Using COUNTIF
Named Ranges Alternative: To make the formula cleaner, you can define a Named Range for the list in Workbook B, and reference that name in your conditional formatting rule.
Efficient Spreadsheet Data Management

Highlight and Compare Cross-Workbook Data with WPS Office

WPS Spreadsheet provides powerful and intuitive tools for cross-workbook referencing, advanced conditional formatting, and 3-D data consolidation. Easily track matching daily records without performance lag.

  1. 1. Open Both Workbooks: Launch WPS Spreadsheet and open both your daily logs (Workbook A) and reference list (Workbook B).
  2. 2. Select Target Cells: Group your daily tabs in Workbook A and select the data column you wish to evaluate.
  3. 3. Access Conditional Formatting: Go to 'Home' > 'Conditional Formatting' > 'New Rule'.
  4. 4. Apply the Formula: Select 'Use a formula...', input your COUNTIF formula pointing to Workbook B, choose your highlight color, and click 'OK'.
Fully compatible with Microsoft Excel (.xlsx) file formats.Seamlessly handle cross-workbook formulas like COUNTIF and VLOOKUP.Apply conditional formatting rules across multiple grouped worksheets easily.Free, lightweight, and fast alternative for heavy data analysis tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use conditional formatting that refers to another workbook?

Yes, you can use formulas like COUNTIF or MATCH in conditional formatting to refer to an external workbook. However, both workbooks usually need to be open simultaneously for the formatting to evaluate and update properly.

Why did my highlights disappear when I closed Workbook B?

Conditional formatting rules containing external references often lose their connection or return an error when the source workbook is closed. To restore the highlights, reopen the source workbook and recalculate the sheets.

What is a 3-D reference in Excel?

A 3-D reference refers to the same cell or range across multiple consecutive worksheets. For example, 'Sheet1:Sheet5'!A1 refers to cell A1 in Sheet1, Sheet2, Sheet3, Sheet4, and Sheet5.

How do I apply conditional formatting to multiple sheets at once?

Hold the Shift key and click the sheet tabs to group them. Then, select the target range and apply your conditional formatting rule. The rule will automatically be applied to the same range in all grouped sheets.