Function for splitting variable fuel cost of a trip
A calculator which splits fuel cost accurately between people on a journey based on;
1. Each fuel stop actual cost, plus
2. Miles travelled between fuel stops, plus
3. Travellers present between stops OR distance travelled by each person between fuel stops.
For example, I am setting off on a road trip with 3 people (4 including me the driver) and 1 person is being dropped off on the way to visit family but will be picked up when we are returning.
Another person is just going one way and will be making their own way back.
The remaining person and me (just 2 out of 4 people) will be present for 100% of the trip.
The road trip is 1,000 miles in total and we will be filling up the car 5-6 times with various amounts of fuel at various cost per litre.
The car does a better mpg on motorway (open/fast roads) than around town.
A calculator which can work out a share of the total cost based on how many miles each person travelled and which fuel stops applied to those miles would be great.