Changing a formula calculation when a total passes a pre-defined value

davidatgb

New Member
Joined
Aug 16, 2011
Messages
2
Hello. I need the help of a better brain than mine, please.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Has anyone ever seen or worked out a formula for calculating mileage allowances when the first 10,000 miles in a year is claimed at $0.45 per mile and all mileage over 10,000 is calculated at $0.25 per mile?
<o:p></o:p>
I tried this one =IF(C38<10000,(D12*0.45),(D12*0.25)) where: <o:p></o:p>
D12 is the cell containing the mileage entered that day.<o:p></o:p>
C38 is the sum of all my accumulated mileage that year and is the sum of all the values calculated in column D.
<o:p></o:p>
This does not work properly, of course, because as soon as the number in C38 exceeds 10,000, all previous cells as well as all subsequent cells revert to the 0.25 value and I lose my first 10,000 miles using the .45 value.<o:p></o:p>
Can anyone suggest a formula that allows the calculation in all cells in column D to be and remain at 0.45 while C38 remains below 10,000, and then switch the calculation to the 0.25 value in subsequent cells only once C38 exceeds 10,000?
<o:p></o:p>
Thank you in advance - David.<o:p></o:p>
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Assuming your data starts in d1 you can use this or adjust.

=IF(SUM($D$1:D1)<10000,D1*0.45,D1*0.25)

And of course copy down. Its not perfect but maybe more of what you are looking for.
 
Upvote 0
try:

=MIN(10000,C38)*0.45+MAX(0,C38-10000)*0.25

I think there's a better way still, but this ought to do it.
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top