How to find records that appear in both datasets

The fastest way to find matching records between two Excel lists is to use the VLOOKUP or INDEX/MATCH formula, which searches one list for values that exist in another. You add a helper column next to your first dataset, write a formula that checks whether each value appears in the second dataset, and then filter to show only the matches. The entire process takes a few minutes once you understand the formula syntax.

Excel has no single "intersection" button, so you are building the logic yourself. The method you choose depends on whether your datasets are in the same workbook, how large they are, and whether you need the result as a new list or just want to mark which rows match.

Key Takeaways

  • VLOOKUP with IFERROR is the simplest approach: it searches for each value in your first list within your second list and returns a result only if a match exists.
  • You add the formula in a helper column, copy it down for every row, then filter or copy only the rows where the formula returned a match.
  • If your lookup column is not the leftmost column in your second dataset, use INDEX/MATCH instead of VLOOKUP to avoid errors.
  • For very large datasets (over 100,000 rows), a pivot table or the built-in Remove Duplicates feature may be faster than formulas.

Using VLOOKUP to mark matching rows

Open your workbook with both datasets. Put your first dataset in columns A through C (or however many columns it has), and your second dataset starting in column E. In column D, next to your first dataset, type a header like "Match Found".

In cell D2 (the first data row below your header), type this formula: =IFERROR(VLOOKUP(A2,$E$2:$E$1000,1,FALSE),"No Match"). Replace A2 with the column letter of the value you want to search for, and replace $E$2:$E$1000 with the actual range of your second dataset. The dollar signs lock the range so it does not change when you copy the formula down.

Press Enter. If the value in A2 exists anywhere in column E, the formula returns that value. If it does not exist, it returns "No Match". Copy this formula down to every row in your first dataset by clicking D2, then dragging the small square at the bottom-right corner of the cell down to the last row of data.

Now filter column D to show only rows where the result is not "No Match". Click any cell in your data, then go to the Data tab and click Filter. Click the dropdown arrow in column D and uncheck "No Match". You now see only the rows that exist in both datasets.

Using INDEX/MATCH when the lookup column is not first

VLOOKUP only works if the column you are searching for is the leftmost column in your second dataset. If your second dataset has ID numbers in column E but names in column F, and you want to match on names, VLOOKUP will fail. Use INDEX/MATCH instead.

In cell D2, type: =IFERROR(INDEX($E$2:$E$1000,MATCH(A2,$F$2:$F$1000,0)),"No Match"). The MATCH function finds the position of A2 within column F, and INDEX returns the value from column E at that same position. Replace the column letters and ranges with your actual data.

Copy this formula down the same way as VLOOKUP. The result is identical — you get a match indicator in column D that you can filter on.

Creating a new list of only the matching records

If you want a clean new list showing only the intersection (not your original data with a filter applied), copy the filtered results and paste them into a new location. After you filter column D to show only matches, select all visible rows, copy them, and paste into a blank area of your workbook or a new sheet.

Right-click the pasted data and choose Paste Special. Click Values Only and then OK. This removes the formulas and leaves you with a static list of only the matching records. You can then delete the helper column (column D) if you no longer need it.

Handling datasets with duplicate values

If your first dataset has the same value in multiple rows, VLOOKUP and INDEX/MATCH will mark all of them as matches if that value appears anywhere in the second dataset. This is usually what you want — if "Smith" appears three times in your first list and once in your second list, all three instances are matches.

If you need to match on multiple columns at once (for example, first name AND last name together), modify the formula to concatenate columns. In D2, type: =IFERROR(VLOOKUP(A2&B2,$E$2:$F$1000,1,FALSE),"No Match"). This searches for the combination of A2 and B2 together. You must also add a helper column in your second dataset that concatenates the same columns in the same order, and include that column in your VLOOKUP range.

Using Remove Duplicates for a simpler approach

If both datasets contain the same type of data (for example, two lists of customer IDs with no other columns), you can combine them and use Excel's Remove Duplicates feature. Copy your first dataset, paste it below your second dataset in the same column, then select all the combined data.

Go to the Data tab and click Remove Duplicates. Excel removes every value that appears only once, leaving only the values that were in both lists. This method is faster than formulas for simple lists but does not work if you need to preserve other columns or see which rows matched.

Comparing datasets in different workbooks

If your two datasets are in separate Excel files, open both workbooks. In the workbook containing your first dataset, use the same VLOOKUP or INDEX/MATCH formula, but reference the other workbook in the range. Type: =IFERROR(VLOOKUP(A2,[Book2.xlsx]Sheet1!$E$2:$E$1000,1,FALSE),"No Match"). Replace Book2.xlsx with the actual filename and Sheet1 with the actual sheet name.

Excel will ask you to enable external links the first time you open the file. Click Enable. The formula works the same way as if both datasets were in the same workbook, but the second workbook must remain open for the formula to calculate.

Frequently Asked Questions

What is the difference between VLOOKUP and INDEX/MATCH?

VLOOKUP searches for a value in the leftmost column of a range and returns a value from a column to the right. INDEX/MATCH is more flexible — it can search any column and return a value from any other column. For most tasks, VLOOKUP is simpler; use INDEX/MATCH when your lookup column is not the first column in your range.

Why does my VLOOKUP formula return #N/A?

This means the value was not found in your second dataset. Check that the value exists exactly as written (watch for extra spaces or different capitalization). If the value is a number, make sure both columns are formatted as numbers, not text. Wrap your VLOOKUP in IFERROR to replace #N/A with a readable message like "No Match".

Can I find the intersection of more than two datasets?

Yes, but you need multiple helper columns. Add a second helper column that checks whether each row from the first intersection also appears in a third dataset, using the same VLOOKUP or INDEX/MATCH formula. Filter to show only rows where both helper columns show a match.

Is there a way to do this without formulas?

The Remove Duplicates method requires no formulas if both datasets are simple lists in a single column. For anything more complex, formulas are the standard approach. Pivot tables can also find intersections but require more setup and are better suited to summarizing data than extracting matches.

How do I save just the matching records as a new file?

After filtering to show only matches, select all visible data and copy it. Create a new workbook, paste the data, then save the file with a new name. Make sure to use Paste Special > Values Only to remove the formulas, so the new file contains only the static data.