Function Problems

How to Return a Blank When a Value Exists in Another Excel Range

Khadija KhanKhadija Khan Nov 10, 2026 868 views

Question details

The user needs to compare two ranges and return a blank cell if a value from the first range is found in the second range, otherwise keeping the original value.

How to Return a Blank When a Value Exists in Another Excel Range
Product
Excel
Device & OS
not provided
Scenario
Comparing two lists of data and filtering out matching values by replacing them with blanks.
Observed behavior
A dynamic array formula is required to automatically spill results across multiple cells, showing blanks for matched values and the original data for non-matches.
Before you start

Ensure that the output range where the formula will spill its results (e.g., C1:C4) is completely empty to prevent a #SPILL! error.

Solution 1Recommended

Use IF, ISNUMBER, and XMATCH with Dynamic Arrays

This is the most efficient method for newer spreadsheet versions. It uses a dynamic array to compare ranges automatically and spill the results down the column.

The XMATCH function searches for a specified item in an array and returns its relative position. By wrapping it in ISNUMBER, we can determine if a match was successfully found. Finally, the IF function evaluates this true/false result to output either a blank string or the original value.

1
Select the Output Cell

Click on the first cell where you want the filtered data to appear (for example, C1).

2
Input the Formula

Type the formula =IF(ISNUMBER(XMATCH(A1:A4,D1:D4)),"",A1:A4) into the formula bar.

3
Apply and Spill

Press the Enter key. The formula will automatically spill down through the required cells (e.g., C1:C4), leaving a blank for any matches and retaining the original value for non-matches.

Use IF, ISNUMBER, and XMATCH with Dynamic Arrays
Dynamic Spill Feature: Because this formula leverages dynamic arrays, you only need to enter it into the top cell (C1). It will automatically populate the remaining cells below it.

Effortlessly Compare Data Ranges in WPS Spreadsheet

WPS Office fully supports advanced functions like XMATCH and dynamic arrays, allowing you to quickly compare datasets, clean up data, and apply complex logical formulas with ease.

  1. 1. Open your Data File: Launch WPS Spreadsheet and open the document containing the two data ranges you want to compare.
  2. 2. Select Output Cell: Click on the top cell of your intended output column (e.g., C1).
  3. 3. Enter the Formula: Type =IF(ISNUMBER(XMATCH(A1:A4,D1:D4)),"",A1:A4) and press Enter.
  4. 4. View the Results: Watch as WPS Spreadsheet instantly calculates and spills the matched blanks and non-matched values down the column.
100% compatible with Microsoft Excel formulas and functionsNatively supports modern dynamic array capabilities like XMATCH and FILTERFree, lightweight, and fast processing for large datasets
microsoft office alternative - wps office

Frequently Asked Questions

Why am I getting a #SPILL! error when I enter the dynamic array formula?

A #SPILL! error occurs when the dynamic array formula doesn't have enough empty space below it to output all the results. Check the cells directly below your formula (e.g., C2 to C4) and clear any existing text or data to fix the issue.

Can I use COUNTIF instead of XMATCH to return a blank for matching values?

Yes, you can use the formula =IF(COUNTIF($D$1:$D$4, A1)>0, "", A1) and drag it down. However, combining XMATCH with dynamic arrays is generally faster and more efficient for modern spreadsheet tasks since you don't need to manually copy the formula.

Does the XMATCH formula work in all versions of Excel?

No, the XMATCH function and dynamic arrays were introduced in newer versions like Microsoft 365, Excel 2021, and recent WPS Office updates. If you are using Excel 2019 or earlier, you should use the IF and MATCH combination instead.