Cannot make formula SPILL down

DaveyP

New Member
Joined
Jan 13, 2022
Messages
5
Office Version
  1. 2021
Platform
  1. Windows
Hello,

I have been trying without success to update my spreadsheet with SPILLed formulas to reduce the file size.
The attached mini-sheet is a re-creation of a small portion of my spreadsheet (as it is several hundred rows and many worksheets).
My current formula in column K works fine. I can also make it work as a CSE formula (Col. L). However when I make it SPILL (Col. M) I get a #VALUE! error in all of the SPILLed cells.
I have tried various approaches i.e. using SUMPRODUCT instead of SUM and FILTER instead of XLOOKUP.
Any help would be appreciated. NOTE: I am using Excel 2021 (It has a number of the newer ARRAY functions, but not all of the functions that come with 365
Thx.
Gain Loss Calc v4.xlsx
ABDKLMNPRVXZADAFAHAL
1DateStockDate PurchNON-ARRAY Gain/LossCSE Gain/LossSPILL ARRAY Gain/LossAQN_ExDivDateAQN_PayDateAQN_DivBCE_ExDivDateBCE_PayDateBCE_DivIHI_ExDivDateIHI_PayDateIHI_Div
22023-07-05AQN2022-06-010.870.87#VALUE!2023-03-302023-04-140.1442023-06-142023-07-151.28707-Jun-2313-Jun-230.071
32023-07-05BCE2021-09-157.347.34#VALUE!2022-12-292023-01-130.2402023-03-142023-04-151.28723-Mar-2329-Mar-230.028
42023-07-05IHI2021-01-160.990.99#VALUE!2022-09-282022-10-140.2402022-12-142023-01-161.22413-Dec-2219-Dec-220.097
52022-06-292022-07-150.2402022-09-142022-10-151.22426-Sep-2230-Sep-220.146
62022-03-302022-04-140.2272022-06-142022-07-151.22409-Jun-2215-Jun-220.064
72021-12-302022-01-140.2272022-03-142022-04-151.22424-Mar-2230-Mar-220.007
82021-09-282021-10-150.2272021-12-142022-01-151.16430-Dec-2105-Jan-220.106
92021-06-292021-07-150.2272021-09-142021-10-151.16424-Sep-2130-Sep-210.039
102021-03-302021-04-150.2062021-06-142021-07-151.16410-Jun-2116-Jun-210.406
112020-12-302021-01-150.2062021-03-122021-04-151.16425-Mar-2131-Mar-210.029
122020-09-292020-10-150.2062020-12-142021-01-151.10714-Dec-2018-Dec-200.539
132020-06-292020-07-150.2062020-09-142020-10-151.10723-Sep-2029-Sep-200.263
142020-03-302020-04-150.1882020-06-122020-07-151.10715-Jun-2019-Jun-200.252
152019-12-302020-01-150.1882020-03-132020-04-151.10725-Mar-2031-Mar-200.028
162019-09-272019-10-150.1882019-12-132020-01-151.05430-Dec-1906-Jan-200.049
172019-06-272019-07-150.1882019-09-132019-10-151.05416-Dec-1920-Dec-190.531
182019-03-282019-04-150.1712019-06-132019-07-151.05424-Sep-1930-Sep-190.251
Sheet1
Cell Formulas
RangeFormula
K2:K4K2=SUMIFS(XLOOKUP($B2&"_Div",DivHeader,DivData,,0), XLOOKUP($B2&"_ExDivDate",DivHeader,DivData,,0),">"&$D2, XLOOKUP($B2&"_PayDate",DivHeader,DivData,,0),"<="&$A2)
L2:L4L2=SUMIFS(XLOOKUP($B2&"_Div",DivHeader,DivData,,0), XLOOKUP($B2&"_ExDivDate",DivHeader,DivData,,0),">"&$D2, XLOOKUP($B2&"_PayDate",DivHeader,DivData,,0),"<="&$A2)
M2:M4M2=SUMIFS(XLOOKUP($B2:B4&"_Div",DivHeader,DivData,,0), XLOOKUP($B2:$B4&"_ExDivDate",DivHeader,DivData,,0),">"&$D2:$D4, XLOOKUP($B2:$B4&"_PayDate",DivHeader,DivData,,0),"<="&$A2:$A4)
V2:V18,AL2:AL18,AD2:AD18V2=U2
A2A2=TODAY()
A3:A4A3=$A$2
Press CTRL+SHIFT+ENTER to enter array formulas.
Dynamic array formulas.
Named Ranges
NameRefers ToCells
DivData=Sheet1!$O$2:$AL$18M2, K2:L4
DivHeader=Sheet1!$O$1:$AL$1M2, K2:L4
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
See how this goes. I have assumed that the hidden O1 does not begin with "AQN_"

23 07 06.xlsm
ABDKLMPRVXZADAFAHAL
1DateStockDate PurchNON-ARRAY Gain/LossCSE Gain/LossSPILL ARRAY Gain/LossAQN_ExDivDateAQN_PayDateAQN_DivBCE_ExDivDateBCE_PayDateBCE_DivIHI_ExDivDateIHI_PayDateIHI_Div
26/07/2023AQN1/06/20220.8640.86430/03/202314/04/20230.14414/06/202315/07/20231.2877/06/202313/06/20230.071
36/07/2023BCE15/09/20217.3477.34729/12/202213/01/20230.2414/03/202315/04/20231.28723/03/202329/03/20230.028
46/07/2023IHI16/01/20210.9930.99328/09/202214/10/20220.2414/12/202216/01/20231.22413/12/202219/12/20220.097
529/06/202215/07/20220.2414/09/202215/10/20221.22426/09/202230/09/20220.146
630/03/202214/04/20220.22714/06/202215/07/20221.2249/06/202215/06/20220.064
730/12/202114/01/20220.22714/03/202215/04/20221.22424/03/202230/03/20220.007
828/09/202115/10/20210.22714/12/202115/01/20221.16430/12/20215/01/20220.106
929/06/202115/07/20210.22714/09/202115/10/20211.16424/09/202130/09/20210.039
1030/03/202115/04/20210.20614/06/202115/07/20211.16410/06/202116/06/20210.406
1130/12/202015/01/20210.20612/03/202115/04/20211.16425/03/202131/03/20210.029
1229/09/202015/10/20200.20614/12/202015/01/20211.10714/12/202018/12/20200.539
1329/06/202015/07/20200.20614/09/202015/10/20201.10723/09/202029/09/20200.263
1430/03/202015/04/20200.18812/06/202015/07/20201.10715/06/202019/06/20200.252
1530/12/201915/01/20200.18813/03/202015/04/20201.10725/03/202031/03/20200.028
1627/09/201915/10/20190.18813/12/201915/01/20201.05430/12/20196/01/20200.049
1727/06/201915/07/20190.18813/09/201915/10/20191.05416/12/201920/12/20190.531
1828/03/201915/04/20190.17113/06/201915/07/20191.05424/09/201930/09/20190.251
DaveyP
Cell Formulas
RangeFormula
M2:M4M2=BYROW(A2:D4,LAMBDA(rw,LET(fc,MATCH(INDEX(rw,2)&"_*",DivHeader,0),SUMIFS(INDEX(DivData,0,fc+6),INDEX(DivData,0,fc),">"&INDEX(rw,4),INDEX(DivData,0,fc+2),"<="&INDEX(rw,1)))))
A2A2=TODAY()
A3:A4A3=$A$2
K2:K4K2=SUMIFS(XLOOKUP($B2&"_Div",DivHeader,DivData,,0), XLOOKUP($B2&"_ExDivDate",DivHeader,DivData,,0),">"&$D2, XLOOKUP($B2&"_PayDate",DivHeader,DivData,,0),"<="&$A2)
Dynamic array formulas.
Named Ranges
NameRefers ToCells
DivData=DaveyP!$O$2:$AL$18M2, K2:K4
DivHeader=DaveyP!$O$1:$AL$1M2, K2:K4
 
Upvote 0
Thank you for the quick response. Unfortunately my Excel 2021 doesn't have the newer functions such as BYROW LAMBDA etc. I have FILTER, LET, MMULT, UNIQUE and the X's ie XLOOKUP, XMATCH but not the newest features available with the 365 subscription version. Is there a work around using ROW or ROWS?
 
Upvote 0
Unfortunately my Excel 2021 doesn't have the newer functions such as BYROW LAMBDA etc.
:oops: Sorry, I keep forgetting about exactly what is in 2021 (as I don't have it)
I'm not sure that you will be able to get spilled results for that circumstance. (Happy for somebody to prove me wrong though :))
 
Upvote 0

Forum statistics

Threads
1,224,261
Messages
6,177,502
Members
452,782
Latest member
ZCapitao

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