What this calculator does
This tool is modeled on a Japanese workplace drinking-party (nomikai) bill split, where it is customary for women to pay a smaller share, senior bosses (senpai joshi) to pay extra or a fixed premium, and the organizer (kanji) to absorb the leftover rounding remainder. The roles reflect a Japanese social custom; the arithmetic itself is universal. All amounts are in Japanese yen.
How to use it
Enter the total bill, choose a rounding unit (each person's share is rounded up to a clean multiple), and enter the total number of people attending. Then specify how many are senior bosses and whether they pay a fixed amount or a surcharge on top of a man's share, how many are women and their payment ratio relative to a man. The remaining attendees are treated as men, and one of them is the organizer.
The formula explained
First the seniors' money is handled: a fixed senior simply pays that amount; a surcharge senior pays a man's share plus the surcharge. The rest of the bill is split across man-equivalent units, where each woman counts as womenRate of a man. The base man share is then rounded up to the rounding unit for every person. Because every share rounds up, the total collected is slightly more than the bill, and that surplus is refunded to the organizer.
$$\text{manPays} = \left\lceil \frac{\text{remainingAmount}}{\text{equivalentUnits} \times \text{roundingUnit}} \right\rceil \times \text{roundingUnit}$$$$\text{baseManShare} = \frac{\text{remainingAmount}}{\text{menEquivalent} + \text{womenCount}\times\text{womenRate}}$$$$\text{roundUpTo}(x,u) = \lceil x/u \rceil \times u$$
Worked example
Bill 28,760 yen, rounding 500, 6 people, 1 senior with a 2,000 surcharge, 2 women at 70%. Men = \(6 - 1 - 2 = 3\). Remaining = \(28{,}760 - 2{,}000 = 26{,}760\). Units = \((3+1) + 2\times0.7 = 5.4\). Base man share = \(26{,}760 / 5.4 = 4{,}955.56\). Man pays 5,000, woman pays 3,500, senior pays 7,000. Collected = \(5{,}000\times3 + 3{,}500\times2 + 7{,}000 = 29{,}000\). Organizer refund = \(29{,}000 - 28{,}760 = 240\) yen.
FAQ
Is the organizer an extra person? No. The organizer is one of the attendees and, when at least one man is present, is counted as a man who pays the man's share and then receives the remainder back.
What if a fixed senior amount exceeds the bill? The senior payment is capped so the seniors never pay more than the total bill.
Why is more collected than the bill? Every share is rounded up to a clean amount, so the small surplus is returned to the organizer.