Here is another awk version of that script that's a little more concise and sorts, like the above, using newer features that are in gawk:
#!/usr/local/bin/gawk -E
BEGIN{
FS=","
}
{
total_wins[$1]+=$7;
total_losses[$1]+=$8;
}
END{
print "manager,total_wins,total_losses"
n = asorti(total_wins, managers)
for (i=1; i<=n; i++){
m = managers[i]
print m "," total_wins[m] "," total_losses[m]
}
}
(I recommend using gawk over mawk or nawk. You might need to install it over the awk that came with your OS.)