TakeLargestBy

WMA link


TakeLargestBy[list, f, n]

returns the a sorted list of the n largest items in list
using f to retrieve the items' keys to compare them.

For details on how to use the ExcludedForms option, see TakeLargest[].

TakeSmallestBy