Formula that would roll forward the amount (netting the amounts)

jeongs1

New Member
Joined
May 23, 2017
Messages
44
So, with a help from great excel experts in this forum, I was able to get the formula that would give me the results for STEP 1. Now, I need help for STEP 2. F

or an example, I want ABC's Session 2 for Feb-17 to be the net value of from both Jan-17 and Feb-17, which would equal to ZERO. Then for Mar-17, ABC's Session 2 would become 12.

Another example would be for ABC's Session 3 for Feb-17 would be 230, netting/accumulating both Jan and Feb. Then for Mar-17, it would become 242, all of Jan, Feb, and Mar.

I feel like "<="&EOMONTH should be used somewhere, but not quite sure how and where I would insert it... Greatly appreciate any help!!!


[TABLE="class: cms_table_grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A​
[/TD]
[TD]
B​
[/TD]
[TD]
C​
[/TD]
[TD]
D​
[/TD]
[TD]
E​
[/TD]
[/TR]
[TR]
[TD]
1​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]17-Jan[/TD]
[TD]17-Feb[/TD]
[TD]17-Mar[/TD]
[/TR]
[TR]
[TD]
2​
[/TD]
[TD]ABC[/TD]
[TD]Session 1[/TD]
[TD]–[/TD]
[TD]-50[/TD]
[TD]–[/TD]
[/TR]
[TR]
[TD]
3​
[/TD]
[TD]ABC[/TD]
[TD]Session 2[/TD]
[TD]-15[/TD]
[TD]15[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]
4​
[/TD]
[TD]ABC[/TD]
[TD]Session 3[/TD]
[TD]30[/TD]
[TD]200[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]
5​
[/TD]
[TD]BCD[/TD]
[TD]Session 1[/TD]
[TD]400[/TD]
[TD]–[/TD]
[TD]-300[/TD]
[/TR]
[TR]
[TD]
6​
[/TD]
[TD]BCD[/TD]
[TD]Session 2[/TD]
[TD]-50[/TD]
[TD]100[/TD]
[TD]150[/TD]
[/TR]
[TR]
[TD]
7​
[/TD]
[TD]BCD[/TD]
[TD]Session 3[/TD]
[TD]–[/TD]
[TD]-50[/TD]
[TD]–[/TD]
[/TR]
[TR]
[TD]
8​
[/TD]
[TD]CDE[/TD]
[TD]Session 1[/TD]
[TD]16[/TD]
[TD]300[/TD]
[TD]–[/TD]
[/TR]
[TR]
[TD]
9​
[/TD]
[TD]CDE[/TD]
[TD]Session 2[/TD]
[TD]50[/TD]
[TD]100[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD]
10​
[/TD]
[TD]CDE[/TD]
[TD]Session 3[/TD]
[TD]90[/TD]
[TD]-10[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]



[TABLE="class: cms_table_grid"]
<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]
[/TR]
[TR]
[TD]
12​
[/TD]
[TD]Input Sheet[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
13​
[/TD]
[TD][/TD]
[TD]
17-Jan​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
17-Feb​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
17-Mar​
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
14​
[/TD]
[TD][/TD]
[TD]Session 1[/TD]
[TD]Session 2[/TD]
[TD]Session 3[/TD]
[TD]Session 1[/TD]
[TD]Session 2[/TD]
[TD]Session 3[/TD]
[TD]Session 1[/TD]
[TD]Session 2[/TD]
[TD]Session 3[/TD]
[/TR]
[TR]
[TD]
15​
[/TD]
[TD]ABC[/TD]
[TD]–[/TD]
[TD]-15[/TD]
[TD]30[/TD]
[TD]-50[/TD]
[TD]15[/TD]
[TD]200[/TD]
[TD]–[/TD]
[TD]12[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]
16​
[/TD]
[TD]BCD[/TD]
[TD]400[/TD]
[TD]-50[/TD]
[TD]–[/TD]
[TD]–[/TD]
[TD]100[/TD]
[TD]-50[/TD]
[TD]-300[/TD]
[TD]150[/TD]
[TD]–[/TD]
[/TR]
[TR]
[TD]
17​
[/TD]
[TD]CDE[/TD]
[TD]16[/TD]
[TD]50[/TD]
[TD]90[/TD]
[TD]300[/TD]
[TD]100[/TD]
[TD]-10[/TD]
[TD]–[/TD]
[TD]15[/TD]
[TD]5[/TD]
[/TR]
</tbody>[/TABLE]


B15=INDEX($C$2:$E$10,MATCH($A15,$A$2:$A$10,0)+MATCH(B$14,$B$2:$B$4,0)-1,MATCH(B$13,$C$1:$E$1,0))
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
How's this?


Excel 2010
ABCDEFGHI
117-Jan17-Feb17-Mar17-Jan17-Feb17-Mar
2ABCSession 10-5000-50-50
3ABCSession 2-151512-15012
4ABCSession 3302001230230242
5BCDSession 14000-300400400100
6BCDSession 2-50100150-5050200
7BCDSession 30-5000-50-50
8CDESession 116300016316316
9CDESession 2501001550150165
10CDESession 390-105908085
Sheet1
Cell Formulas
RangeFormula
G2=SUM($C2:C2)
 
Upvote 0
That's not going to work since I have Data Sheet and Input Sheet in the format as above... I'd love to change the format around, but can't. :(
 
Upvote 0
That's not going to work since I have Data Sheet and Input Sheet in the format as above... I'd love to change the format around, but can't. :(

I assumed that you were showing us what you have already. Is that not the case?

I was basing my formula off of that top table. If you prefer to base the formula off of the bottom table, you can try this:


Excel 2010
ABCDEFGHIJ
1Jan-17Feb-17Mar-17
2ABCSession 10-50-50
3ABCSession 2-15012
4ABCSession 330230242
5BCDSession 1400400100
6BCDSession 2-5050200
7BCDSession 30-50-50
8CDESession 116316316
9CDESession 250150165
10CDESession 3908085
11
12Input Sheet
13Jan-17Jan-17Jan-17Feb-17Feb-17Feb-17Mar-17Mar-17Mar-17
14Session 1Session 2Session 3Session 1Session 2Session 3Session 1Session 2Session 3
15ABC0-1530-501520001212
16BCD400-5000100-50-3001500
17CDE165090300100-100155
Sheet1
Cell Formulas
RangeFormula
C2=SUMPRODUCT(($A$15:$A$17=$A2)*($B$13:$J$13<=C$1)*($B$14:$J$14=$B2)*($B$15:$J$17))
 
Last edited:
Upvote 0
Thank you!!!

Another quick question. Is there a way to do that with the below formula? Using "<="&EOMONTH inserted somewhere inside last MATCH? Just curious.

B15=INDEX($C$2:$E$10,MATCH($A15,$A$2:$A$10,0)+MATCH(B$14,$B$2:$B$4,0)-1,MATCH(B$13,$C$1:$E$1,0))
 
Upvote 0
Thank you!!!

Another quick question. Is there a way to do that with the below formula? Using "<="&EOMONTH inserted somewhere inside last MATCH? Just curious.

B15=INDEX($C$2:$E$10,MATCH($A15,$A$2:$A$10,0)+MATCH(B$14,$B$2:$B$4,0)-1,MATCH(B$13,$C$1:$E$1,0))

You're welcome. Happy to help.

My formulas are in C2:E10. They refer to the table on the bottom.

Are you saying that your formulas are in B15:J17 and refer to the top table?

I am confused as to where your data is vs where you want the results to be.
 
Upvote 0
Sorry for the confusion. Yes, my formulas would go in to B15:J17. The data is the very first table and I want the result to be in the second table where it's labeled as "Input Sheet".
 
Upvote 0
Sorry for the confusion. Yes, my formulas would go in to B15:J17. The data is the very first table and I want the result to be in the second table where it's labeled as "Input Sheet".

Alright, in that case try this:


Excel 2010
ABCDEFGHIJ
1Jan-17Feb-17Mar-17
2ABCSession 10-500
3ABCSession 2-151512
4ABCSession 33020012
5BCDSession 14000-300
6BCDSession 2-50100150
7BCDSession 30-500
8CDESession 1163000
9CDESession 25010015
10CDESession 390-105
11
12Input Sheet
13Jan-17Jan-17Jan-17Feb-17Feb-17Feb-17Mar-17Mar-17Mar-17
14Session 1Session 2Session 3Session 1Session 2Session 3Session 1Session 2Session 3
15ABC0-1530-500230-5012242
16BCD400-50040050-50100200-50
17CDE1650903161508031616585
Sheet1
Cell Formulas
RangeFormula
B15=SUMPRODUCT(($A$2:$A$10=$A15)*($B$2:$B$10=B$14)*($C$1:$E$1<=B$13)*($C$2:$E$10))


Note that I filled in the blank cells in row 13 with the correct month.
 
Upvote 0
It gave me "#N/A" :(

Then your layout (or data) must be different from the example that you gave because as you can see from post #8, it works fine for me.

Try copying and pasting the example from post #8 in a separate worksheet and see if you can get the formula working there before moving on to your actual sheet.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

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