# How do you split Friendsgiving costs fairly?

Split shared dinner costs by the number of shares each person has, then show who owes and who should get money back.

Page: https://straightgate.pages.dev/t/friendsgiving-cost-splitter/

## Formula and worked examples

### Sample dinner: Ana, Ben + Cy (2 shares), Dee, Eli

Inputs: people = [['Ana', 1], ['Ben + Cy', 2], ['Dee', 1], ['Eli', 1]], expenses = [['Ana', 84], ['Ben + Cy', 45], ['Eli', 31]]

Results: total = 160.0, per_share = 32.0, Ana = {'paid': 84.0, 'fair': 32.0, 'balance': 52.0, 'msg': 'Gets back $52.00'}, Ben + Cy = {'paid': 45.0, 'fair': 64.0, 'balance': -19.0, 'msg': 'Owes $19.00'}, Dee = {'paid': 0.0, 'fair': 32.0, 'balance': -32.0, 'msg': 'Owes $32.00'}, Eli = {'paid': 31.0, 'fair': 32.0, 'balance': -1.0, 'msg': 'Owes $1.00'}

### Two people, one paid $40

Inputs: people = [['A', 1], ['B', 1]], expenses = [['A', 40]]

Results: total = 40.0, per_share = 20.0, A = {'paid': 40.0, 'fair': 20.0, 'balance': 20.0, 'msg': 'Gets back $20.00'}, B = {'paid': 0.0, 'fair': 20.0, 'balance': -20.0, 'msg': 'Owes $20.00'}

### Two people, each paid $25

Inputs: people = [['A', 1], ['B', 1]], expenses = [['A', 25], ['B', 25]]

Results: total = 50.0, A = {'paid': 25.0, 'fair': 25.0, 'balance': 0.0, 'msg': 'All square'}, B = {'paid': 25.0, 'fair': 25.0, 'balance': 0.0, 'msg': 'All square'}

## Related spreadsheets

- [Friendsgiving Cost Splitter Spreadsheet – Split Shared Dinner Costs Fairly (Excel)](https://straightgate.pages.dev/p/cmoux.md) — $3. Buy: https://straightgate.gumroad.com/l/cmoux?wanted=true
