I'm trying to solve the requirement mentioned in the above subject line. To do that, I have taken the following formula from the link mentioned below
=INDEX($B$3:$B$7, SMALL(IF(SMALL(IF(COUNTIF($D$2:D2, $B$3:$B$7)+ISBLANK($B$3:$B$7)=0, COUNTIF($B$3:$B$7, "<"&$B$3:$B$7)+1, ""), 1)=IF(ISBLANK($B$3:$B$7), "", COUNTIF($B$3:$B$7, "<"&$B$3:$B$7)+1), ROW($B$3:$B$7)-MIN(ROW($B$3:$B$7))+1), 1), MATCH(MIN(IF(COUNTIF($D$2:D2, $B$3:$B$7)+ISBLANK($B$3:$B$7)>0, "", COUNTIF($B$3:$B$7, "<"&$B$3:$B$7)+1)), INDEX(IF(ISBLANK($B$3:$B$7), "", COUNTIF($B$3:$B$7, "<"&$B$3:$B$7)+1), SMALL(IF(SMALL(IF(COUNTIF($D$2:D2, $B$3:$B$7)+ISBLANK($B$3:$B$7)=0, COUNTIF($B$3:$B$7, "<"&$B$3:$B$7)+1, ""), 1)=IF(ISBLANK($B$3:$B$7), "", COUNTIF($B$3:$B$7, "<"&$B$3:$B$7)+1), ROW($B$3:$B$7)-MIN(ROW($B$3:$B$7))+1), 1), , 1), 0), 1)
This formula is working fine in Google sheets as depicted in the screen shot below
But failing (ie not uniquely finding the values) in my laptop excel version - MS Excel 2016 MSO (16.0.4738.1000) 32-bit