Function Problems

How to Find the Row Number of a Duplicate Value in Excel

John WilsonJohn Wilson Nov 11, 2026 869 views

Question details

The user needs a method to identify the exact row number where a duplicate value appears in another column without causing performance issues.

How to Return the Row Number of a Duplicate Value in Excel
Product
Excel
Device & OS
not provided
Scenario
Analyzing large datasets to locate the specific row of duplicated data between columns without triggering spreadsheet lag.
Observed behavior
Traditional lookup or full-column array calculations scan unnecessarily large ranges, resulting in slow and unresponsive Excel performance.
Before you start

Ensure your dataset does not contain unintended blank rows or merged cells that might interfere with array formulas. For optimal performance, identify the approximate maximum row of your data (e.g., row 22000) to avoid referencing entire columns.

Solution 1Recommended

Use XMATCH to Find the Row Number Efficiently

The XMATCH function is highly optimized for performance and is the best choice for returning the exact cell reference of a duplicate value.

XMATCH performs a rapid lookup and, when combined with IFNA, provides a clean cell reference (like B20001) instead of an error when no duplicate is found.

1
Select the result cell

Click on the empty cell where you want the duplicate's row location to be displayed.

2
Enter the XMATCH formula

Type the formula =IFNA("B"&XMATCH(A2, B1:B22000), ""), adjusting A2 to your target value and B1:B22000 to your actual data range in the target column.

3
Execute the formula

Press Enter. The formula will return the column letter and matching row number. Drag the fill handle down to apply it to other cells.

Use XMATCH to Find the Row Number Efficiently
Performance Tip: For the best performance on large datasets, always replace full-column references (like B:B) with realistic, defined ranges (like B1:B22000).
Effortless Data Analysis

Process Large Datasets smoothly with WPS Spreadsheet

WPS Spreadsheet is a powerful and lightweight tool equipped with an optimized calculation engine. It processes complex array formulas like XMATCH, MATCH, and FILTER rapidly, allowing you to locate duplicate row numbers in massive datasets without experiencing frustrating lag.

  1. 1. Install WPS Office: Download and install the free WPS Office suite on your computer.
  2. 2. Open your dataset: Launch WPS Spreadsheet and open your existing Excel workbook (.xlsx or .xls).
  3. 3. Apply duplicate formulas: Use the XMATCH or FILTER formulas in an empty column to locate your duplicate row numbers instantly.
  4. 4. Save your work: Save your spreadsheet with perfect format and formula retention.
Fully compatible with Microsoft Excel formulas and .xlsx file formats.Optimized calculation engine designed to handle large datasets and complex arrays smoothly.Free to use with a familiar, easy-to-navigate interface for quick adoption.Built-in advanced data analysis tools without hefty subscription fees.
microsoft office alternative - wps office

Frequently Asked Questions

Why does referencing an entire column (like A:A) slow down my spreadsheet?

Referencing entire columns forces the calculation engine to process over a million rows (1,048,576). For resource-heavy functions like COUNTIF or array formulas, this exponentially increases calculation time. Always restrict your formula to defined data ranges (like A1:A22000) for better performance.

Does XMATCH work in older versions of Excel?

No, the XMATCH function is available only in Excel 365, Excel 2021, and newer versions (as well as WPS Spreadsheet). If you are using an older version of Excel, you will need to rely on the traditional MATCH function.

How can I visually highlight duplicate rows instead of finding their numbers?

You can use Conditional Formatting for a visual approach. Select your data range, navigate to the Home tab, click on Conditional Formatting > Highlight Cells Rules > Duplicate Values, and choose a preferred color format to highlight the duplicates.

What does the IFNA function do in the XMATCH formula?

IFNA handles the #N/A error that naturally occurs when XMATCH searches for a value but cannot find a duplicate. Instead of cluttering your spreadsheet with error codes, IFNA catches it and returns a blank cell string (""), keeping your data clean and readable.