Spreadsheet: 836715d1689604055-automatic-top-10-ranking-by-date-reference-example2-6-aligw
Sheet: Sheet1

 |  | Reason A | Reason B | Reason C | Reason D | Reason E | Reason F | Reason G | Reason H | Reason I | Reason J |  |  |  | 2023-07-04 00:00:00 | Date entered manually, then populates top 10 ranking below |  |  |  | 1 | Week # entered manually, then populates top 10 ranking below
Dates | Week # |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 1
2023-07-03 00:00:00 | 1 | 125 | 7 | 3 | 29 |  | 1 | 1 |  |  | 15 |  |  |  | Rank | Reason | Quantity |  |  | Rank | Reason | Quantity
2023-07-04 00:00:00 | 1 | 97 | 9 | 9 | 24 | 1 | 4 | 1 | 1 | 1 | 16 |  |  |  | 1 | Reason A | 97 |  |  | 1 | Reason A | 671
2023-07-05 00:00:00 | 1 | 137 | 9 | 17 | 28 |  | 1 | 3 |  | 1 | 9 |  |  |  | 2 | Reason D | 24 |  |  | 2 | Reason D | 183
2023-07-06 00:00:00 | 1 | 84 | 8 | 8 | 32 | 1 | 2 | 2 |  |  | 12 |  |  |  | 3 | Reason J | 16 |  |  | 3 | Reason J | 73
2023-07-07 00:00:00 | 1 | 115 | 9 | 10 | 42 | 3 | 2 |  | 2 | 2 | 11 |  |  |  | 4 | Reason B | 9 |  |  | 5 | Reason C | 52
2023-07-08 00:00:00 | 1 | 80 | 3 | 4 | 12 | 3 |  | 1 |  |  | 6 |  |  |  | 5 | Reason C | 9 |  |  | 4 | Reason B | 46
2023-07-09 00:00:00 | 1 | 33 | 1 | 1 | 16 | 2 |  |  |  |  | 4 |  |  |  | 6 | Reason F | 4 |  |  | 6 | Reason F | 10
2023-07-10 00:00:00 |  | 127 | 6 | 9 | 35 |  | 2 |  | 1 |  | 15 |  |  |  | 7 | Reason E | 1 | Where multiple reasons have the same quantity, ranks alphabetically |  | 7 | Reason E | 10
2023-07-11 00:00:00 |  | 101 | 2 | 18 | 31 |  | 2 |  | 2 |  | 15 |  |  |  | 8 | Reason G | 1 |  |  | 8 | Reason G | 8
2023-07-12 00:00:00 |  | 63 | 2 | 13 | 24 |  | 1 | 1 | 1 | 1 | 11 |  |  |  | 9 | Reason H | 1 |  |  | 10 | Reason I | 4
2023-07-13 00:00:00 |  | 108 | 1 | 6 | 33 | 5 |  |  |  | 4 | 13 |  |  |  | 10 | Reason I | 1 |  |  | 9 | Reason H | 3
2023-07-14 00:00:00 |  | 74 | 4 | 6 | 22 | 2 | 1 |  | 4 | 4 | 4
2023-07-15 00:00:00 |  | 45 | 2 | 3 | 6 | 1 | 2 |  | 3 | 1 | 1 |  |  |  |  | If there are not 10 reasons on the date/week referrenced, returns only the top X available. (i.e. 03/07/2023 would return only top 7)
2023-07-16 00:00:00 |  | 71 | 3 | 4 | 5 |  |  |  |  | 2 | 8
Example of source data |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Example of desired outcome
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | Reason A | 97 |  |  |  | Reason A | 671 |  |  |  | Reason A | 671
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2 | Reason D | 24 |  |  | 2 | Reason D | 183 |  |  | 2 | Reason D | 183
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 3 | Reason J | 16 |  |  | 3 | Reason J | 73 |  |  | 3 | Reason J | 73
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 4 | Reason B | 9 |  |  | 4 | Reason C | 52 |  |  | 4 | Reason C | 52
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 5 | Reason C | 9 |  |  | 5 | Reason B | 46 |  |  | 5 | Reason B | 46
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 6 | Reason F | 4 |  |  | 6 | Reason E | 10 |  |  | 6 | Reason E | 10
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 7 | Reason E | 1 |  |  | 7 | Reason F | 10 |  |  | 7 | Reason F | 10
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 8 | Reason G | 1 |  |  | 8 | Reason G | 8 |  |  | 8 | Reason G | 8
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 9 | Reason H | 1 |  |  | 9 | Reason I | 4 |  |  | 9 | Reason I | 4
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 10 | Reason I | 1 |  |  | 10 | Reason H | 3 |  |  | 10 | Reason H | 3