Function Problems

How to Return the Second Match or Nth Value in Excel

Khadija KhanKhadija Khan Nov 2, 2026 871 views

Question details

The user needs to look up and return the second matching value in a ranked dataset, rather than the first match typically returned by standard lookup functions.

How to Return the Second Match or Nth Value in Excel
Product
Excel
Device & OS
not provided
Scenario
Extracting the second-highest-ranked player for a specific position from a sports roster sorted by rank.
Observed behavior
Standard lookup functions like VLOOKUP or XLOOKUP only return the very first matching record encountered in the dataset.
Before you start

Ensure your dataset is correctly sorted by rank or your preferred criteria before applying these formulas, as the order of the extracted results depends entirely on the source data's sorting order.

Solution 1Recommended

Use INDEX and FILTER to Find the Nth Match

This is the most efficient and straightforward method for modern versions of Excel and WPS Spreadsheet that support dynamic array functions.

By combining the FILTER function with the INDEX function, you can first isolate all matching records and then extract a specific instance, such as the second or third occurrence.

1
Select your target cell

Click on the empty cell where you want the second-highest-ranked player's name to appear.

2
Enter the FILTER function

Type the FILTER function to extract all players matching your criteria. For example: FILTER(C2:C100, B2:B100="SS"), where column C holds names and column B holds positions.

3
Wrap with the INDEX function

Enclose your FILTER formula within an INDEX function and specify the row number as 2 to get the second match. The final formula will look like: =INDEX(FILTER(C2:C100, B2:B100="SS"), 2).

4
Apply the formula

Press Enter to execute the formula. The cell will now display the second matching record from your sorted list.

Use INDEX and FILTER to Find the Nth Match
Cell References: Instead of typing the position "SS" directly into the formula, you can reference another cell (e.g., F2) to make your dashboard fully interactive: =INDEX(FILTER(C2:C100, B2:B100=F2), 2).
Data Management Made Easy

Easily Extract Nth Matching Values in WPS Spreadsheet

WPS Office fully supports dynamic array functions like FILTER, INDEX, and SEQUENCE, allowing you to easily look up second, third, or any Nth matching values in your datasets. It provides a seamless experience for advanced data manipulation.

  1. 1. Open your dataset in WPS: Launch WPS Spreadsheet and open your existing workbook containing the ranked data.
  2. 2. Input the dynamic formula: Select an empty cell and type =INDEX(FILTER(return_range, criteria_range="condition"), 2).
  3. 3. Get instant results: Press Enter to instantly view the second matching record without needing complex array keystrokes.
100% compatible with Microsoft Excel formulas and .xlsx filesNative support for modern dynamic array functions like FILTER and XLOOKUPLightweight and fast, ensuring smooth performance even with large datasetsFree to download and features a highly familiar user interface
microsoft office alternative - wps office

Frequently Asked Questions

Can I use VLOOKUP to return the second match in Excel?

Standard VLOOKUP only returns the first matching instance it finds. To return the second match with VLOOKUP, you would need to create a helper column that combines your lookup value with a count (e.g., "SS2"). Using INDEX and FILTER is the recommended modern alternative.

What happens if there is no second match in my data?

If there is no second match, the INDEX function will return a #REF! error because the filtered array doesn't have a second row. You can wrap your formula in the IFERROR function to handle this gracefully, like this: =IFERROR(INDEX(FILTER(...), 2), "Not Found").

How do I return the third or fourth match?

You simply need to change the row number argument at the end of the INDEX function. For the third match, change the 2 to a 3: =INDEX(FILTER(range, criteria), 3). For the fourth, change it to a 4, and so on.