The product in H4 is an input that can be changed at any time.

All data exists in an Excel Table nameddata.

However, this method only works for the first match.

INDEX and MATCH gets first match only

In both formulas, MATCH returns 1 because the product is “A”.

As mentioned, this is a standard tool of INDEX and MATCH.

For a complete overview, see:How to use INDEX and MATCH.

INDEX and MATCH gets first match only

The other row numbers have been replaced by FALSE.

With 1 in cell G7, SMALL returns the smallest value, which is 1.

This is returned directly to the INDEX function asrow_num.

INDEX and MATCH gets first match only

At each new row, the formula returns the next nth match.

Theexample hereshows one approach.

Multiple criteria

To add multiple criteria, you useboolean logic, asexplained in this example.

INDEX and MATCH gets first match only

you’ve got the option to use INDEX to retrieve individual values, or entire rows and columns.

from a set of numeric data.

More than one condition can be tested by nesting IF functions.

INDEX and MATCH gets first match only

Excel formula: Get relative row numbers in range

Excel formula: INDEX and MATCH all matches

Excel formula: INDEX and MATCH all partial matches

Excel formula: Get nth match

Excel INDEX function

Excel SMALL function

Excel IF function

INDEX and MATCH gets first match only