I am currently learning the new array functions in Excel. I've been learning them for a bit, but still learning.
I am trying to create a dynamic YTD type report off some dummy data however I can't seem to get it to work as I'd hoped.
I have data in A1:B14, dummy dates (A) and values (B), 12 are 1st of the months 1-12, 2 are dates in the month to test the next stage.
In D1, i have number from 1-12, showing the January to x months.
So far I have got:
=LET(
_data,$A$1:$B$14,
_months,SEQUENCE(,$D$1,1,1),
_dates,DATE(2025,_months,1),
_results,(CHOOSECOLS(FILTER(_data,CHOOSECOLS(_data,1)=DATE(2025,10,1)),2)),
_totals,(BYCOL(_results,LAMBDA(a,SUM(a)))),
VSTACK(_dates,_totals))
Which correctly gives me the sum in once cell for the 1st October value, however, I am getting in a mess when trying to use _dates, instead of the hard coded date, it gives a #value error.
_results,(CHOOSECOLS(FILTER(_data,CHOOSECOLS(_data,1)=_dates),2)),
As mentioned, I am learning these so this data is dummy data.
I would like this to show a sum for each month, equivalent of SUMIF dragged across.


