How to Highlight Values Missing from Another Column in Excel
Question details
Highlight values in one column that do not appear in another reference column.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Comparing two lists of data within a spreadsheet to identify and highlight missing records.
- Observed behavior
- The user needs to visually isolate unique values in the target column that are absent from the reference column, ensuring that blank cells are not incorrectly highlighted.
Ensure that both columns of data you want to compare are in the same worksheet, and take note of their exact cell ranges (for example, target range B2:B100 and reference range G2:G25).
Use COUNTIF and AND Functions in Conditional Formatting
Apply a custom formula rule using the COUNTIF function to identify missing values, combined with the AND function to exclude empty cells from being highlighted.
This method involves creating a new conditional formatting rule based on a logical formula. The formula checks each cell in your target column against the reference column. If the count is zero (meaning it is missing) and the cell is not blank, the formatting is applied.
Click and drag to select the cells in the column you want to format, such as B2:B100. Make sure B2 is the active cell in your selection.
Navigate to the Home tab on the top ribbon, click on Conditional Formatting, and select New Rule from the dropdown menu.
Choose the option 'Use a formula to determine which cells to format'. In the formula box, enter: =AND(COUNTIF($G$2:$G$25,B2)=0,B2<>"") replacing $G$2:$G$25 with your actual reference column range.
Click the Format button, go to the Fill tab, and choose a distinct color like red to highlight the missing values. Click OK twice to apply the rule to your data.

Highlight Missing Values Easily in WPS Spreadsheet
WPS Spreadsheet fully supports custom conditional formatting formulas like COUNTIF and AND. You can effortlessly compare lists, highlight missing data, and analyze your spreadsheets with a familiar and highly compatible interface.
- 1. Open your workbook in WPS Spreadsheet: Launch WPS Office and open the file containing the two columns you wish to compare.
- 2. Select your data range: Highlight the target column data (e.g., Column B) that needs to be checked for missing values.
- 3. Create a new formatting rule: Go to the Home tab, click Conditional Formatting, select New Rule, and choose 'Use a formula to determine which cells to format'.
- 4. Input the formula and format: Enter the formula =AND(COUNTIF($G$2:$G$25,B2)=0,B2<>""), click Format to select a highlight color, and click OK.

Frequently Asked Questions
Can I highlight values missing from a column on a different sheet?
Yes, you can reference a different sheet in your COUNTIF formula by including the sheet name. For example: =AND(COUNTIF(Sheet2!$G$2:$G$25,B2)=0,B2<>"").
Why are my blank cells getting highlighted by the conditional formatting rule?
If you only use the COUNTIF function, Excel may treat blank cells as zeroes and highlight them. To prevent this, always pair COUNTIF with the AND function and add the condition B2<>"" to explicitly ignore empty cells.
How do I highlight matching values instead of missing ones?
To highlight values that exist in both columns, modify the formula to look for a count greater than zero. Use this formula instead: =COUNTIF($G$2:$G$25,B2)>0.
Does this conditional formatting formula work for text values as well as numbers?
Yes, the COUNTIF formula evaluates both text strings and numerical values identically, making it perfect for comparing names, product codes, or inventory numbers.




