Is something like this table what you are after? If so, enter the following formula in B1,
and this one in C1,
Code:
=IF($A1-SUM($B1:B1)>15000,15000,$A1-SUM($B1:B1))
Then, copy C1 and paste it down the column.
Now, copy B1 to the end of the column and paste down the row.
[TABLE="width: 576"]
<tbody>[TR]
[TD="class: xl65, width: 64, align: right"]98765[/TD]
[TD="class: xl65, width: 64, align: right"]15000[/TD]
[TD="class: xl65, width: 64, align: right"]15000[/TD]
[TD="class: xl65, width: 64, align: right"]15000[/TD]
[TD="class: xl65, width: 64, align: right"]15000[/TD]
[TD="class: xl65, width: 64, align: right"]15000[/TD]
[TD="class: xl65, width: 64, align: right"]15000[/TD]
[TD="class: xl65, width: 64, align: right"]8765[/TD]
[TD="class: xl65, width: 64, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]32104[/TD]
[TD="class: xl65, align: right"]15000[/TD]
[TD="class: xl65, align: right"]15000[/TD]
[TD="class: xl65, align: right"]2104[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]66592[/TD]
[TD="class: xl65, align: right"]15000[/TD]
[TD="class: xl65, align: right"]15000[/TD]
[TD="class: xl65, align: right"]15000[/TD]
[TD="class: xl65, align: right"]15000[/TD]
[TD="class: xl65, align: right"]6592[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]15000[/TD]
[TD="class: xl65, align: right"]15000[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]15001[/TD]
[TD="class: xl65, align: right"]15000[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]14999[/TD]
[TD="class: xl65, align: right"]14999[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]