Trying to make an equation for calculating pay for employees based on hours worked and a baseline percentage. I run a small carpentry crew and I want to pay my employees based off of a percentage of the funds that I have available to me during any cycle of a given job. For instance Lets say I have these employees at these percentages:

*

*Employee 1 @ 50%

*Employee 2 @ 25%

*Employee 3 @ 25%

I then want to disburse $1000, but the employees may not have worked the same hours on a project. Maybe it looks something like this.




Employee 1
Employee 2
Employee 3




4 hours
4 hours
8 hours


50%
25%
25%




So I need my equations for each employees pay to incorporate their given percentage but still take into account the hours worked. The sum of each employees pay should add up to $1000 for this example.
My best but incorrect attempt was as follows:
We have a total of 16 hours worked and $1000 dollars to be disbursed. I then calculate a generic hourly rate (ghr):
$$1000/16=62.5= ghr$$
I then plug that into this equation for each employee to find their personal hourly rate (phr):
$$ghr*N*P=phr$$
Where "N" is the number of employees, and "P" is an individuals percentage.
For this example this gives
Employee 1 phr = $93.75
Employee 2 phr = $46.875
Employee 3 phr = $46.875
Now multiplying each employees phr by hours earned gives the following payouts:
Employee 1 pay = \$93.75 * 4 hrs = \$375
Employee 2 pay = \$46.875 * 4 hrs = \$187.5
Employee 3 pay = \$46.875 * 8 hrs = \$375.
However,
$$375+187.5+375 = 937.5 \neq 1000.$$
Clearly I have not gone about this properly, any ideas on the proper equation?
 A: The trouble is you're trying to figure out the hourly rate for each employee separately, and it's much more efficient to do this with a slightly different metric.
Instead of dividing by the number of hours in total, it helps to come up with an "effective hours" for each employee, where that's the product of their share and the number of hours they worked. ​This would look something like the following:




Employee
Share
Actual Hours
Effective Hours




1
50%
4
2


2
25%
4
1


3
25%
8
2


Total
100%
16
5




Then, instead of dividing the bounty by $16$ (the sum of the hours), divide it by $5$ (the sum of the effective hours), and each employee gets the number of effective hours times that value.
In this case, we'll end up with each employee earning $\frac{1000}{5} = \$200 $ per effective hour, rather than calculating individual rates for each employee.
Then, each employee's share of the bounty is:




Employee
Share
Actual Hours
Effective Hours
Share of Bounty




1
50%
4
2
\$400


2
25%
4
1
\$200


3
25%
8
2
\$400


Total
100%
16
5
\$1,000




With this system, you have employee 1 earning twice as much as employee 2, which you'd want since they worked the same number of hours, but employee 1's share is double employee 2's. You also have employee 3 earning twice as much as employee 2, which also is consistent with the fact that they have the same share, but employee 3 worked twice as many hours. And, employee 1 and employee 3 earn the same amount, also consistent with the fact that employee 1's share is double employee 3's, but employee 3 worked twice as many hours.
And, if you need to have a specific wage you're paying each employee, you can work that out by dividing the share of the bounty you arrive at through this system by the number of actual hours worked:




Employee
Share
Actual Hours
Effective Hours
Share of Bounty
Actual Wage




1
50%
4
2
\$400
\$100


2
25%
4
1
\$200
\$50


3
25%
8
2
\$400
\$50


Total
100%
16
5
\$1,000
--



