Subtract an amount from a cell, then move and subtract from the next available amount

Digit4L

New Member
Joined
Feb 28, 2019
Messages
2
Dear All,

I have tried to subtract the Overdue Invoice Amount, It should go like below table.

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[TD]K
[/TD]
[TD]L
[/TD]
[TD]M
[/TD]
[TD]N
[/TD]
[TD]O
[/TD]
[TD]P
[/TD]
[TD]Q[/TD]
[TD]R[/TD]
[TD]S
[/TD]
[TD]T
[/TD]
[TD]U
[/TD]
[TD]V
[/TD]
[TD]W
[/TD]
[TD]X
[/TD]
[TD]Y
[/TD]
[TD]Z
[/TD]
[TD]AA
[/TD]
[TD]AB
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]AMT $
[/TD]
[TD]TTL DUE
[/TD]
[TD]JAN
[/TD]
[TD]FEB
[/TD]
[TD]MAR
[/TD]
[TD]APR
[/TD]
[TD]MAY
[/TD]
[TD]JUN
[/TD]
[TD]JUL
[/TD]
[TD]AUG
[/TD]
[TD]SEP
[/TD]
[TD]OCT
[/TD]
[TD]NOV
[/TD]
[TD]DEC
[/TD]
[TD]PAID
[/TD]
[TD]OD BAL. TTL
[/TD]
[TD]JAN
[/TD]
[TD]FEB
[/TD]
[TD]MAR
[/TD]
[TD]APR
[/TD]
[TD]MAY
[/TD]
[TD]JUN
[/TD]
[TD]JUL
[/TD]
[TD]AUG
[/TD]
[TD]SEP
[/TD]
[TD]OCT
[/TD]
[TD]NOV
[/TD]
[TD]DEC
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]XYZ INC
[/TD]
[TD]44
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]20
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]14
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]10
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]25
[/TD]
[TD="align: center"]19
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]9
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]10
[/TD]
[TD="align: center"]0
[/TD]
[/TR]
</tbody>[/TABLE]



[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]FORMULA USED
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Q3
[/TD]
[TD]=MAX(SUM(C3:C3)-O3,0)
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]R3
[/TD]
[TD]=IF(OR(Q3>0, D3=""),"",MAX(SUM(C3:D3)-O3,0))
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]S3
[/TD]
[TD]=IF(OR(R3>0, E3=""),"",MAX(SUM(C3:E3)-O3,0))
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]T3
[/TD]
[TD]=IF(OR(S3>0, F3=""),"",MAX(SUM(C3:F3)-O3,0))
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]U3
[/TD]
[TD]=IF(OR(T3>0, G3=""),"",MAX(SUM(C3:G3)-O3,0))
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]V3
[/TD]
[TD]=IF(OR(U3>0, H3=""),"",MAX(SUM(C3:H3)-O3,0))
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]W3
[/TD]
[TD]=IF(OR(V3>0, I3=""),"",MAX(SUM(C3:I3)-O3,0))
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]X3
[/TD]
[TD]=IF(OR(W3>0, J3=""),"",MAX(SUM(C3:J3)-O3,0))
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Y3
[/TD]
[TD]=IF(OR(X3>0, K3=""),"",MAX(SUM(C3:K3)-O3,0))
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Z3
[/TD]
[TD]=IF(OR(Y3>0, L3=""),"",MAX(SUM(C3:L3)-O3,0))
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]AA3
[/TD]
[TD]=IF(OR(Z3>0, M3=""),"",MAX(SUM(C3:M3)-O3,0))
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]AB3
[/TD]
[TD]=IF(OR(AA3>0, N3=""),"",MAX(SUM(C3:N3)-O3,0))
[/TD]
[/TR]
</tbody>[/TABLE]

But I am getting the below, Till Aug its fine, but after Aug it showing empty.
Totally Struck, Looking for support.

[TABLE="width: 500"]
<tbody>[TR]
[TD]1
[/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[TD]J
[/TD]
[TD]K
[/TD]
[TD]L
[/TD]
[TD]M[/TD]
[TD]N[/TD]
[TD]O[/TD]
[TD]P
[/TD]
[TD]Q
[/TD]
[TD]R
[/TD]
[TD]S
[/TD]
[TD]T
[/TD]
[TD]U
[/TD]
[TD]V
[/TD]
[TD]W
[/TD]
[TD]X
[/TD]
[TD]Y
[/TD]
[TD]Z
[/TD]
[TD]AA
[/TD]
[TD]AB
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]AMT $
[/TD]
[TD]TTL DUE
[/TD]
[TD]JAN
[/TD]
[TD]FEB
[/TD]
[TD]MAR
[/TD]
[TD]APR
[/TD]
[TD]MAY
[/TD]
[TD]JUN
[/TD]
[TD]JUL
[/TD]
[TD]AUG
[/TD]
[TD]SEP
[/TD]
[TD]OCT
[/TD]
[TD]NOV
[/TD]
[TD]DEC
[/TD]
[TD]PAID
[/TD]
[TD]OD BAL>
[/TD]
[TD]JAN
[/TD]
[TD]FEB
[/TD]
[TD]MAR
[/TD]
[TD]APR
[/TD]
[TD]MAY
[/TD]
[TD]JUN
[/TD]
[TD]JUL
[/TD]
[TD]AUG
[/TD]
[TD]SEP
[/TD]
[TD]OCT
[/TD]
[TD]NOV
[/TD]
[TD]DEC
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]XYZ INC
[/TD]
[TD]44
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]20
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]14
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]10
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]25
[/TD]
[TD="align: center"]9
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]0
[/TD]
[TD="align: center"]9
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
</tbody>[/TABLE]

Thanks a lot,
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Why not just Sum C through O and make your payment amount negative? Then it's just the sum of all of those combined?
 
Upvote 0
How about in R3 copied right
=IF(D3=0,0,MAX(SUM($C3:D3)-$O3,0)-SUM($Q3:Q3))
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

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