Excel: Is it possible to use Spilled Arrays for a Cost Recovery Reconciliation Table without Circular References"

jrhouse5

New Member
Joined
Sep 8, 2023
Messages
9
Office Version
  1. 365
Platform
  1. Windows
I have been converting older spreadsheets to spilled arrays to improve and simplify logic. However, there is one area I cannot convert to a spilled array without the dreaded circular reference! Below is a simplified version of a table where costs are recovered from reveneue before the profit is split. I am hoping there is a solution to eliminate the circular reference in this calcuation. Thanks.

CR Spill Array Test.xlsx
BCDEFGHIJKLMN
2Time Periods1012345678910
3
4ANNUAL
5Costs58,50010,00010,0005,0005,0005,00010,0002,5002,5006,0002,500
6Revenue75,000--20,00020,00010,0005,0005,0005,0005,0005,000
7
8OLD WAY
9Cost Recovery Reconcuiliation Table
10Beginning--10,00020,0005,000--5,0002,500-1,000
11Costs Adds58,50010,00010,0005,0005,0005,00010,0002,5002,5006,0002,500
12Cost Recovery58,500--20,00010,0005,0005,0005,0005,0005,0003,500
13End-10,00020,0005,000--5,0002,500-1,000-
14
15
16SPILLED ARRAY --> Results in CIRCULAR REFERENCES!
17Cost Recovery Reconcuiliation Table
18Beginning--#REF!#REF!#REF!#REF!#REF!#REF!#REF!#REF!#REF!
19Costs Adds58,50010,00010,0005,0005,0005,00010,0002,5002,5006,0002,500
20Cost Recovery#REF!-#REF!#REF!#REF!#REF!#REF!#REF!#REF!#REF!#REF!
21End#REF!10,000#REF!#REF!#REF!#REF!#REF!#REF!#REF!#REF!#REF!
Sheet1
Cell Formulas
RangeFormula
E2:N2E2=TRANSPOSE(SEQUENCE(C2))
C5:C6,C19:C20,C11:C12C5=SUM(E5:N5)
F10:N10F10=E13
E11E11=E$5
F11:N11F11=F5
E12:N12E12=MIN(E$10+E$11,E$6)
E13:N13,C13E13=E10+E11-E12
C18C18=INDEX(E18:N18,1)
C21C21=INDEX(E21#,C2)
E18:N18E18=MAKEARRAY(1,$C$2,LAMBDA(r,c,IF(c=1,0,INDEX(E21#,c))))
E19:N19E19=Costs
E20:N20E20=MAKEARRAY(1,$C$2,LAMBDA(r,c,MIN(INDEX(E18#,c)+INDEX(E19#,c),INDEX(Revenue,c))))
E21:N21E21=MAKEARRAY(1,$C$2,LAMBDA(r,c,SUM(INDEX(E19#,1):INDEX(E19#,c))-SUM(INDEX(E20:N20,1):INDEX(E20:N20,c))))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Costs=Sheet1!$E$5:$N$5E19, C5, E11
Revenue=Sheet1!$E$6:$N$6E20, C6, E12
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I can replicate your Cost Recovery line (E12:N12) with the formula:

=LET(AllCosts,Costs+HSTACK(0,DROP(SCAN(0,Costs-Revenue,LAMBDA(a,b,MAX(0,a+b))),,-1)),IF(AllCosts>Revenue,Revenue,AllCosts))
 
Upvote 1
Solution

Forum statistics

Threads
1,223,869
Messages
6,175,087
Members
452,611
Latest member
bls2024

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