I am hoping someone smarter than I can possibly help with this one. I have tried to use algebra to explain but it's been years since I have used it so it probably sucks =( I'll be very grateful if anyone can help!

I am looking for a formula/table that can do a distribution. I will have an intial amount that will need to be distributed as follows:

1st amount: x needs to be distributed to y number of people (making the individual amount x/y)

2nd amount: (total-x)*0.175 (17.5 % of the remaining amount)

3rd amount: is distributed to b people and should be (x/y)/2 per person

The total of these three should be the same as the total.

Thanks and sorry if I am confusing!