Subtracting a number until 0 then go on to next row

NTNTNT

New Member
Joined
Jul 22, 2015
Messages
5
Hi,

I have question:

For example I have these numbers:

ABCDE
20000150001000012500015000

<colgroup><col><col span="3"><col></colgroup><tbody>
</tbody>

And I have a decrease of 40000 on these categories and I want to subract this number from the first category (A), and then subtract what is left on the second category (B) until the decrease of 40000 became 0.

How can I model this in a function?

Kind Regards,

NTNTNT
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
1​
20,000​
15,000​
10,000​
125,000​
15,000​
40,000​
2​
40,000​
-​
-​
5,000​
125,000​
15,000​
40,000​
B2 and across: =MAX(0, SUM($A1:B1) - SUM($A2:A2))
 
Upvote 0
in your example assuming the data is in row 1, and that your number of 40000 is in G1

in a2 =IF(SUM($A$1:A1)<$G$1,"0",SUM($A1:$C1)-$G$1)

in b2 =IF(SUM($A$1:A1)>$G$1,B1,IF(SUM($A$1:B1)<$G$1,"0",SUM($A1:$C1)-$G$1)) and drag along.
 
Upvote 0
Thank you very much both!

I am trying to implement this in my excel but both formula's do not work. I am working in Excel 2013, could it be that things differ? Is it possible to send me your xls file?
 
Upvote 0
The formula will work in any version of Excel, and this forum does not support posting attachments.
 
Upvote 0
error.png


Thanks. The following error is showing when I try both methods.
 
Upvote 0
But if the values are in column then what would be the formula. Say I had A1 10000 ; B1 15000 ; C1 10000 ... so on till Z1 10000. And if I write in C1 50000 then A1 should be 0 ; B1 should be 0; until 50000 complete. Again in C2 i have 20000 then the remaining from 1st column should get subtracted the carry on the formula down.

Kindly help. If my query is not clear please buzz me, i'll try to simplify more.

Regards
Swami Kastur
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,311
Members
449,080
Latest member
jmsotelo

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