See attached. The formula is fairly compact, but is an array formula so if you change it you will need to press Ctrl + Shift + Enter to compute.
You can change the number of largest by adding/subtracting items from the final array of numbers {1,2,3}.
For your first question which I didnt see at first you could also use
=AVERAGE(IF(($B$3&$C$3=$B$7:$B$25&$C$7:$C$25)+($C$3&$B$3=$B$7:$B$25&$C$7:$C$25),$F$7:$F$25))
Which is also an array formula so needs Ctrl + Shift + Enter
Bookmarks