Function Problems

How to Return a Matching Unique Value for Duplicates in Excel

Kushani NimanthikaKushani Nimanthika Nov 11, 2026 868 views

Question details

The user needs a formula to look up a unique nonblank value in one column that corresponds to a duplicate value in another column, specifically outputting the result only when the current target cell is blank.

How to Return a Matching Unique Value When a Duplicate Is Found in Excel
Product
Excel
Device & OS
not provided
Scenario
Filling incomplete data sets or cleaning records where some duplicate entries have corresponding unique values missing in adjacent cells.
Observed behavior
The user wants to conditionally output the found nonblank value only if the current row's designated column is empty.
Before you start

Ensure your data ranges are locked with absolute references (like $E$3:$E$12) so the formula maintains the correct target area when dragged down the column.

Solution 1Recommended

Use INDEX and MATCH Array Formula

This method uses IFERROR, IF, INDEX, and MATCH functions to precisely locate the nonblank corresponding value for a duplicate entry.

This formula first checks if the current cell in your target column is blank. If it is, it searches the array for a matching ID where the value column is not blank, returning that unique value while gracefully handling errors.

1
Select the destination cell

Click on the cell where you want the result to appear (e.g., cell G3).

2
Enter the array formula

Input the formula: =IFERROR(IF(F3="",INDEX($F$3:$F$12,MATCH(1,($E$3:$E$12=E3)*($F$3:$F$12<>""),0)),""),"")

3
Confirm the formula

If you are using an older version of Excel, you must press Ctrl+Shift+Enter to confirm it as an array formula. Newer versions with dynamic array support will calculate it automatically simply by pressing Enter.

4
Fill down the column

Click and drag the fill handle at the bottom-right corner of the cell to apply the formula to the rest of your dataset.

Use INDEX and MATCH Array Formula
Version Compatibility: In Microsoft 365 and newer WPS Office versions, dynamic arrays process this natively. Older versions require Ctrl+Shift+Enter to add the curly braces {} around the formula.
WPS Spreadsheet Solutions

Easily Manage Complex Array Formulas with WPS Spreadsheet

WPS Spreadsheet fully supports advanced array formulas, dynamic arrays, and nested INDEX/MATCH functions natively. It easily handles duplicate matching and data cleaning tasks with high performance and seamless compatibility.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your duplicate data.
  2. 2. Apply the lookup formula: Paste the INDEX/MATCH formula into the desired blank cell next to your data.
  3. 3. Fill the series: Double-click or drag the fill handle in the bottom-right corner of the cell to apply the formula across your dataset automatically.
Fully compatible with Microsoft Excel formulas and functionsNative support for dynamic arrays without needing Ctrl+Shift+EnterBuilt-in error checking and formula auditing toolsLightweight, fast, and free to use
microsoft office alternative - wps office

Frequently Asked Questions

Why is my formula returning a #VALUE! error?

This typically happens in older spreadsheet versions if you press Enter instead of Ctrl+Shift+Enter when inputting an array formula. Make sure to confirm the formula properly so curly braces appear around it.

What does the '1' mean in the MATCH function in this formula?

The '1' acts as the lookup value representing TRUE. The criteria portion creates an array of 1s and 0s (TRUE and FALSE conditions), and MATCH searches for the first '1' where both the duplicate matches and the target cell is not blank.

How do I adjust the lookup ranges if my data expands?

To accommodate expanding data, update the absolute row numbers in your formula (e.g., change $12 to $1000). Alternatively, format your data range as a Table and use structured references, which automatically expand.

Can I use XLOOKUP instead of INDEX and MATCH for this?

Yes, if your version supports XLOOKUP, you can achieve similar results by using Boolean logic within the lookup array (e.g., XLOOKUP(1, (Range1=Value)*(Range2<>""), ReturnRange)). However, INDEX and MATCH provide broader compatibility with older versions.