Formula for subtracting from one cell before subtracting from another

HelpExcelHelpers

New Member
Joined
May 5, 2018
Messages
15
I have a column for each Banked, Bankable, Borrowed, Used, and Remaining - for each year.

Under K6 I have this formula for "Banked"
=IF(ISBLANK(J6)=true,"0",If(F6<N6,0,F6-N6))
*Basically this formula is grabbing from the previous year only when I enter a date in J6 otherwise it's blank.

Under L6 I have this formula for "Bankable"
=(C2-G6)
*Giving me the year's amount minus the borrowed amount from the previous year* THIS IS THE ONE THAT I NEED HELP ON.

Under N6 for "Used" this is where I will type in a number and I want this number to deduct from K6 first then deduct from L6 once K6 is at zero.

Under O6 for "Remaining" I have this formula which is only pulling from K6 and not doing a thing to L6

=if(sum(K6,L6)N6>0,sum(K6,L6,M6),L6+M6)

Can anyone help me sort this out PLEASE!!


 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
I have a column for each Banked, Bankable, Borrowed, Used, and Remaining - for each year.

Under K6 I have this formula for "Banked"
=IF(ISBLANK(J6)=true,"0",If(F6<N6,0,F6-N6))
*Basically this formula is grabbing from the previous year only when I enter a date in J6 otherwise it's blank.

Under L6 I have this formula for "Bankable"
=(C2-G6)
*Giving me the year's amount minus the borrowed amount from the previous year* THIS IS THE ONE THAT I NEED HELP ON.

Under N6 for "Used" this is where I will type in a number and I want this number to deduct from K6 first then deduct from L6 once K6 is at zero.

Under O6 for "Remaining" I have this formula which is only pulling from K6 and not doing a thing to L6

=if(sum(K6,L6)N6>0,sum(K6,L6,M6),L6+M6)

Can anyone help me sort this out PLEASE!!



Do you have a link to the sheet?
 
Upvote 0
Under K6 I have this formula for "Banked"
=IF(ISBLANK(J6)=true,"0",If(F6 < N6, 0, F6-N6))

Write 0 instead of "0". Do not put quotes around values that you intend to use as numbers.

Better:

=IF(J6="", 0, MAX(0, F6-N6))

Under L6 I have this formula for "Bankable"
=(C2-G6)

Avoid unnecessary parentheses, to improve readability. Simply:

=C2-G6

Under N6 for "Used" this is where I will type in a number and I want this number to deduct from K6 first then deduct from L6 once K6 is at zero.

In M6 (?):

=IF(N6 < K6, K6-N6, L6-N6)

Under O6 for "Remaining" I have this formula which is only pulling from K6 and not doing a thing to L6
=if(sum(K6,L6)N6>0,sum(K6,L6,M6),L6+M6)

=IF(SUM(K6,L6,N6) > 0, SUM(K6,L6,M6), L6+M6)

Is N6 a typo, and it should be M6?

Does that "sort this out"?
 
Last edited:
Upvote 0
Write 0 instead of "0". Do not put quotes around values that you intend to use as numbers.

Better:

=IF(J6="", 0, MAX(0, F6-N6))

Thank you ... I think this one works better!

Avoid unnecessary parentheses, to improve readability. Simply:

=C2-G6

This formula is actually in "Bankable" (L6), but it needs to be more complex than that.

Every year "Bankable" needs to start off with 200 (C2), but this number changes if "Borrowed" from previous year (G6) has a number in it so let's say I enter 50 in (G6) then (L6) should come back with 150 instead of the 200 that it started with. After that L6 also needs to not start deduction until "Banked" (K6) is at zero, then "Bankable" (L6) can start deducting.

Example: I have 200 in "Banked" (K6) and I have 200 in "Bankable" (L6)
(NOTE: M6 is "Borrowed" for that year - where I enter a number and it'll deduct from the next year's "Bankable" amount)

In "Used" N6 - I should be able to enter a number and it deduct the amount in K6 first until it reaches zero and then pull from L6.

In "Remaining" (O6) should be the total K6(Banked)+L6(Bankable)+M6(Borrowed)-N6(Used)=

Here is what I have as of right now in each:

K6 (Banked) FORMULA: =IF(J6="",0,MAX(0,F6-N6))

L6 (Bankable) *FORMULA: =if(N6<C2,C2,C2+K6-N6)-G6
*This formula is not working because it is not deducting AFTER K6 has been exhausted*

O6 (Remaining) should be the total my current formula is:
=if(sum(K6,L6)-N6>0,sum(K6,L6,M6),L6+M6)
BUT it doesn't work properly and I can't figure out what I'm doing wrong. It needs to basically be K6(Banked)+L6(Bankable)+M6(Borrowed)-N6(Used)=
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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