I have a table with data. I want to find the average by Criteria 1 for each Department ID (Department IDs are repeated) and output the value of the Department ID that has the maximum average. How can I do this? [I attach a table with data.]
| Department ID | Criteria 1 |
|---|---|
| DEP 001 | 4 |
| DEP 002 | 2 |
| DEP 003 | 1 |
| DEP 004 | 5 |
| DEP 001 | 3 |
| DEP 003 | 2 |
| DEP 002 | 4 |
| DEP 001 | 3 |
| DEP 004 | 2 |
| DEP 001 | 1 |
| DEP 002 | 3 |
| DEP 003 | 4 |
Average(DEP 001) = (4+3+3+1)/4 = 11/4 = 2.75
Average(DEP 002) = (2+4+3)/3 = 9/3 = 3
Average(DEP 003) = (1+2+4)/3 = 7/3 = 2.3
Average(DEP 004) = (5+2)/2 = 7/2 = 3.5
MAX(Average(DEP 001), Average(DEP 002), Average(DEP 003), Average(DEP 004)) = 3.5
Result = DEP 004

