Hi,
I have got this working but not sure why initial approach caused an error ;
sum figures for each year ;
=LET(yr, UNIQUE(YEAR(D3:D96)), MAP( yr, LAMBDA(x,SUM( IF(YEAR(D3:D96)= x,F3:F96,0)))))
but I wanted to stack the result alongside each year Year / value , so I put Hstack in front of the sum;
=LET(yr, UNIQUE(YEAR(D3:D96)), MAP( yr, LAMBDA(x,HSTACK(x, SUM( IF(YEAR(D3:D96)= x,F3:F96,0))))))
this gives a calc error LET(yr, UNIQUE(YEAR(D3:D96)), MAP(yr, LAMBDA(x, x ))) does return the years so I don't see why the problem,
I have found I can get what I want using ;
LET(yr, UNIQUE(YEAR(D3:D96)), HSTACK(yr, MAP( yr, LAMBDA(x, SUM( IF(YEAR(D3:D96)= x,F3:F96,0))))))
or
=LET(
yr, UNIQUE(YEAR(D3:D96)), asum,MAP(yr, LAMBDA(x, SUM(IF(YEAR(D3:D96) = x, F3:F96, 0)))), HSTACK( yr, asum ))
But if someone can see why the Hstack in front of SUM does not work I would like to know; I have attached workbook all examples;
Richard
Bookmarks