Attached is sample data to illustrate my issue with both sample data and solution.
I am looking to get the highest 3 from "A group", 3 from "B group", 2 from "C group" (blue in solution) and then the top 2 from any group that is left over (green in solution).
This needs to be identified (flagged) by year (2 groups of these top N amounts) and also by both quantity and amount separately. See solution tab for clarity.
Thanks in advance as I have been struggling with this for too long now.