The max gets the larges value in the array...in the case of your sample 2, change the value of one of the staff required cells to a higher number, and it will return that instead