Okay, the only way I could get it to match unique numbers was to do a fancy "Ranking" first to create a unique number list. I did this in rows 3 and 4 (you'd only need 1 but I did it two ways so you have a choice). You could hide that row or even put the font as white so it doesn't show if that suits you.
Row 3 (example for A3) ranking from smallest to largest
Row 4 (e.g. A4) ranking from largest to smallest
Formulas in A6,B6 using row 3
This will give preference with matching numbers to the one on the right thus the result come out as 2, 6.
This set gives the results as 6, 2.
I could not combine everything into 1 formula (removing rows 3 and 4). If that is what you need, I'd suggest starting a new thread with this as your new starting point and see if others can help.
Good luck!
ChemistB
Bookmarks