Rollingλ() is a helper function by BYCOL and BYROW in that it accepts a function as its last argument. creates a running total for values in each row of an array
Rollingλ( Row, [Size], [Offset], [AllowPartial], [Function] )
Row
(Required) A row or values to roll the window over.
Size
(Optional) Window's size (number of values selected). Must be > 0. Default is 3
Offset
(Optional) Number of values to right (+) or Left (-) of current position. Defaults to -2.
AllowPartial
(Optional) TRUE (default) Apply function to selected cells in window.
Function
(Optional) An Excel function or LAMBDA accepting an array of values. Common choices are: SUM, MIN, MAX, and AVERAGE. Default is SUM.
In this example we are calculating straight line depreciation for capital expenditures with a 5 year useful life.
The following functions are provided for those who prefer not to enter functions as parameters/arguments.
RollingAvgλ( Row, [Size], [Offset], [AllowPartial]) - Same as Rollingλ( Row, Size, Offset, AllowPartial, AVERAGE)
RollingMaxλ( Row, [Size], [Offset], [AllowPartial]) - Same as Rollingλ( Row, Size, Offset, AllowPartial, MAX)
RollingMinλ( Row, [Size], [Offset], [AllowPartial]) - Same as Rollingλ( Row, Size, Offset, AllowPartial, MIN)
RollingSumλ( Row, [Size], [Offset], [AllowPartial]) - Same as Rollingλ( Row, Size, Offset, AllowPartial, SUM)