All of the loop functions have a Filter argument that takes a single Boolean expression. This can be used to provide any criteria for filtering the loop. To extract only a single instance of a loop by index value, use the SingleIndex function.
Sorting is done using the Sort argument. The Sort argument takes a variable number of AscendingSort and DescendingSort functions. Each of these functions takes a value that is the actual sort key.