Given your IDs are numeric we can use LARGE to retrieve the ID numbers.
In this particular example we use COUNTIF to determine "k" such that we only retrieve unique numbers.
Simplified example:
so we have 5 unique values (10,9,8,7,5)
B1 we leave blank or enter text then in B2 we use:
Using B2 as example - the COUNTIF will return 0 as no numbers in A1:A10 are greater than the blank/text so "k" is 1 (1+0).
B2 then returns the largest number in A1:A10
Using B3 as example - the COUNTIF will return 2 as 2 numbers >= 10 so "k" becomes 3 (1+2)
B3 then returns the third largest number in A1:A10 which is 9
and so on and so forth and there we have a set of unique numbers
(we add some handlers in the real example such that we don't get errors whilst simultaneously avoiding calculating [potentially expensive] formulae unnecessarily)
Bookmarks