Help with Tax Underpayment Penalty Calculation, Sum Until Value Reached, Save Remainder

JasmineSilver

New Member
Joined
Mar 18, 2017
Messages
4
Hi all,

I have 4 individual numbers, A1-A4 and a range of 4 cells, B1:B4. A1 is supposed to agree to B1, A2 to B2, etc. If A1 is greater than B1, I want the difference to be added to A2 but only if A2 is less than B2, and only until A2 equals B2.

If instead A1 is less than B1, then if A2 is greater than B2, I want the difference from it to be added to A1, but only until A1 equals B1. I hope I'm making sense.

Here's an example:

A1: 400 B1: 500
A2: 650 B2: 500
A3: 500 B3 500
A4: 450 B4: 500

So A1 is under by 100, and I need to pull from the cell below it to make up that 100. If the cell below happens to be less than 100, then I need to pull from the next cell also, until we reach 100. Then A2 must do the same in order to get the value to equal B2, and so on. So A1 gets priority, and once satisfied, A2 gets priority. Finally, I need to know how much A1 pulled from each of the cells below it, how much A2 pulled from each of the cells below it, etc.

If you understand how estimated tax payments work, I'll explain what I'm trying to do. A company must make 4 payments of $500 each (this can vary) every 4 months. So the company should follow range B, but sometimes they will do something like you see in Range A. If they underpaid on A1, then I'm calculating a penalty separately based on how much was underpaid (100). So I need to know when to stop accruing the penalty based on which cells below provided the 100. Usually A2 will be greater than 100, so usually I would stop accruing based on payment 2. But sometimes A2 is under 100, so the remaining portion must be pulled from A3, and perhaps even A4.

In the example above, I need to know which cell provided A1's missing 100, which in this case it should be A2 (but again, even if A2 was 150 instead of 650, the 100 would still get pulled from it because A1 is prioritized until it agrees to B1.) That leaves an extra 50 (650 - 500 - 100) in A2. A3 is fine as is, but A4 needs 50, so I need to know that A4 pulled 50 from A2. I'm incorporating this info into a penalty formula. So for A4, I wouldn't calculate a penalty because while it is less than B4 by 50, that 50 was prepaid with A2.

I have a feeling I'm speaking gibberish, haha. My apologies if I'm not explaining this clearly. Please let me know if there's anything I can clarify. And thank you all.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
My feeble attempt to demystify the situation
Book1
CDE
3PayedDue PayementsPenalty Due
4400500-100
56505000
65005000
74505000
Sheet5
Cell Formulas
RangeFormula
E4:E7E4=MIN(0,SUM($C$4:C4)-SUM($D$4:D4))
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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