> Hey Glenn,

>

> First of all, thanks for all your help but I have one more small (I

> hope) favor to ask.

>

> The formula you gave me;

>

> TotalPayment (calculation, number) = Int( Total Miles / Breakpoint) *

> Base Payment works perfectly but there is another twist that I

> completely forgot about.

>

> If you are on a 1,323 mile trip that buys a hotel every 450 miles at

> $80, the formula figures it to pay $160 or 2 hotel days or 900 miles.

> The twist is that the driver gets yet another hotel for any additional

> mileage over 900 but before the next breakpoint which would be 1,350

> miles. In reality he would get 3 hotels instead of 2

>

> This would be a payment of the full $80 and not pro-rated base on the

> amount of extra mileage between 900 and 1,323.

>

> Example;

>

> Leg 1: 0-450 miles = $80

>

> Leg 2: 451-900 miles = $160

>

> Leg 3: 901-1,323 = $240

>

> Then if the mileage was over 1,350 another $80 would be due

>

> I guess the sticky part is the $0 for <450 miles

>

> I tried a couple of things such as...

>

> TotalPayment (calculation, number) = Int( Total Miles / Breakpoint) *

> Base Payment + Base Payment but this gave the driver a hotel for less

> than 450 miles

>

> TotalPayment (calculation, number) = Int( Total Miles / Breakpoint) *

> Base Payment +.99999 (and also +1) but this only added $1 to the

> final outcome.

>

> This is how my calculation looks as is...

>

> =(Int(Estimated Miles to Home/Driver gets a hotel every ___

> miles)*Amount of Buy Out). These are the actual field names I am

> using.

>

> Sorry about the misinterpretation, sometimes this stuff gets a little

> hairy.

>

> Maybe one day I will be able to do this stuff myself.

>

> Thanks again for all your help.

>

> Charlie

## Bookmarks