# How to find the nth match in Excel

Filter the matches and pick the one you want: `=INDEX(FILTER(A2:A10,B2:B10=F1),H1)` returns match number H1.

**Excel:** `=INDEX(FILTER(A2:A10,B2:B10=F1),H1)` (Excel 2024 and Microsoft 365)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F | G | H |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Date | Customer | Amount |  | Customer | Fabrikam | Visit no. | 2 |
| 2026-04-02 | Contoso | 420 |  | Date |  |  |  |
| 2026-04-06 | Fabrikam | 310 |  |  |  |  |  |
| 2026-04-09 | Northwind | 980 |  |  |  |  |  |
| 2026-04-13 | Contoso | 150 |  |  |  |  |  |
| 2026-04-17 | Fabrikam | 760 |  |  |  |  |  |
| 2026-04-21 | Litware | 230 |  |  |  |  |  |
| 2026-04-24 | Fabrikam | 545 |  |  |  |  |  |
| 2026-04-28 | Contoso | 615 |  |  |  |  |  |
| 2026-05-01 | Northwind | 205 |  |  |  |  |  |

Formula in F2: `=INDEX(FILTER(A2:A10,B2:B10=F1),H1)`

Result: 4/17/2026

## How it works

FILTER returns the dates of every Fabrikam visit as a list, in the order they appear: April 6, 17 and 24. INDEX picks item `H1` from that list, so 2 gives April 17. Change `H1` to 3 for the third visit.

## Other ways

- `=INDEX(A2:A10,SMALL(IF(B2:B10=F1,ROW(A2:A10)-ROW(A2)+1),H1))`: Works in every Excel version: IF keeps the positions of the matching rows and SMALL picks the nth smallest. Confirm with Ctrl+Shift+Enter in Excel 2019 and earlier.
- `=CHOOSEROWS(FILTER(A2:A10,B2:B10=F1),H1)`: CHOOSEROWS also accepts negative numbers: -1 is the last match, -2 the one before it. Excel 2024, Microsoft 365 and Google Sheets.

## Common mistakes

- Asking for more matches than exist returns #REF!. Wrap it as `=IFERROR(INDEX(…),"No visit "&H1)`.
- This is the nth match in list order. For the nth by date, sort first: `INDEX(SORT(FILTER(…)),H1)`.

## Questions

**How do I get the row number of the nth match?**

Return row numbers instead of dates: `=INDEX(FILTER(ROW(A2:A10),B2:B10=F1),H1)`.

**How do I find the nth non-blank value in a column?**

Filter out the blanks: `=INDEX(FILTER(A2:A10,A2:A10<>""),H1)`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/find-nth-match
