There is a group of 15 people, living together for one week.
Different people paid some amount to buy food items, so they had expenditure of €163 as group. They eat breakfast and dinner everyday, but not everyone consumed each meal (for reasons like staying away). For ease, lets say the breakfast costs €7,40 per day and dinner costs €15,86 per day (this is €163 / 7).
I did some calculation and get the amount who has to pay an amount of X to whom. But there was also a donation of €125 to the group. How can I calculate this to the amounts, benefiting the persons which have consumed the most (a person who stayed only one night sould get ledd than one who stayed 6 nights).
I tried to visualize and calculate in a Google Spreadsheet for later usage, but I failed. My logic is wrong. What did I miss, which way would you go?