Why “nights stayed” is not the same as a fair share
The intuitive fix for uneven stays is to weight by nights: add up everyone’s person-nights, and give each guest that fraction of the total. It is much better than dividing by heads, and for a stay where everyone arrives and leaves together it is exactly right. It goes wrong precisely when it is most needed — when occupancy changes partway through.
The reason is that a booking’s cost is incurred one night at a time. On a night with two people in a $200 property, the group spent $200 to accommodate two people; that is $100 each, and no amount of later arithmetic changes it. Person-night weighting treats all ten person-nights in the example above as interchangeable units at $80 apiece, which silently subsidises the nights with the fewest people in the room using money from the nights with the most.
Splitting night by night removes the ambiguity. Each night is a small, self-contained expense with a known set of participants, and a guest’s total is just the sum of the nights they were present for. It is also the version that survives being questioned at the table, because every line of it corresponds to something that visibly happened.