Example file: https://docs.google.com/spreadsheets/d/1iESk7ccWBKBLE6Q00P9AxH3GbOYPO9PysySGbbQljjI/edit?usp=sharing
I have a table showing how many times each player used each item. For each player, I want to identify the X items they used most frequently (3 in the example). The results need to be the names of the items (column headers), not the number of uses.
The solution I've used so far (using BYROW function) is imperfect because it doesn't order them from highest to lowest, and returns all the ties. The first part in particular is where I'm stuck, but how I've dealt with the second part is very rough too.
Tied results should appear in the order of the headings, but are cut off at X. E.g. for top 3, results in order are Item 10 > Item 1 = Item 2 = Item 3 = Item 4, should just display Item 10, Item 1, Item 2.
=byrow(B2:Q10,lambda(row, if(counta(row)=0,,join(",",filter($B$1:$Q$1,row>=LARGE(row,3))))))
Any help would be greatly appreciated.