calculating expense allocated to a manager or department based on the number and type of employees under them.