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 checks if the range matches the given criteria by equating the values, in return we get the row numbers, that are feed to small to get them one by one. Lastly the index function return the corresponding values from our data.