Need to refer to previous rows and columns in spill range

Joe_S

New Member
Joined
Feb 22, 2012
Messages
6
Below is my spill range formula. Variable "result" in the LET is populating the cells. I am struggling to define variables prevAmtRows and PrevAmtColumns which are assigned a value of 999.

What l need PrevAmtRows to do is to calculate the values returned by result in the previous rows of the column. Row 1 is always zero. For example, if rows 1,2, and 3 of column 1 have a value of 100 returned by result, row 4 should return 300 for variable prevAmtRows. PrevAmtColumns is the same concept in that it should calculate the sum of result on the row up to the previous column with column 1 always being zero.

I've read about recursive lambdas and DROP and SCAN function, but still cannot figure it out. This is my final step to complete my task.

Please note that the formula below is in a spill range.


=MAKEARRAY(EndYear-StartYear+1, EndYear-StartYear+1,
LAMBDA(r,c,

LET(
cyLoss, INDEX(MyLosses,r),
cyIncome, INDEX(myIncome,c),
PrevAmtRows, 999
PrevAmtColumns, 999

result, MIN(cyLoss-PrevAmtRows, MAX(0,cyIncome)-PrevAmtColumns),
result)
)
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
It would be helpful if you could post sample data and you're expected result.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,111
Members
453,021
Latest member
Justyna P

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