If you mean to top to bottom should be based on % rate,and if it same it go to quantity.
For Top Five,
Then you can use below ARRAY formula,
For Bottom 5
Then you can use below ARRAY formula,
PS: it just show the rank (ie 1, 2, 3,..., 10,...), for top 5 or bottom, you need to filter or sort. For more convenience, you may use the conditional formatting, there got highlight for top 5 and bottom five apply to this two formula.
ARRAY formula is need to confirm by Ctrl + shift + Enter instead of Enter.
follow these step if you not understand,
1. paste the formula in
2. double click the cell
3. Press Ctrl + shift + Enter
Bookmarks