INDEX(...)

Category: Lookup and reference

Uses an index to choose a value from a reference or array

INDEX(array, row_num, [column_num])

Category: Statistical

Returns the k-th smallest value in a data set

SMALL(array, k)

Category: Logical

Specifies a logical test to perform

IF(Something is True, then do something, otherwise do something else)

Category: Lookup and reference

Returns the row number of a reference

ROW([reference])

0

The formula verifies for the cells in the range that matches the given criteria by equating the values, returning the row numbers, that are feed to small to get them one by one. In the index function return the corresponding values from our data.