I have the current formula
=LET(
rad, ROW(C2),
sumArea, SUM(INDIRECT(ADDRESS(rad,3)):INDIRECT(ADDRESS(rad+5,3))),
result, sumArea/INDIRECT(ADDRESS(rad+6,2)),
result
)
which calculates a five day change from the value in cell B7 with the change column C. It works perfectly when just giving the ROW(C2) argument, but I ideally want it to work with spill, since the C column is itself spilled. When I give the argument ROW(C2#), it does spill, but returns a value error in each of the spilled results.
Is it not possible to use the LET function this way, or can I change something to make it work? I'm thankful for any guidance I can get! :D
Sample data:
The value -28.6% is calculated by taking SUM(-2,2,2,-5,-1)/14.



As others have suggested, using
INDIRECTandADDRESSis not generally a good idea (not least as the functions are volatile so will recalculate every time the sheet changes).With the formula in cell B3
Where B1 is the variable lookback (eg 5 days)
If you have too much time on your hands, or think you might want to re-use this formula, create a
Namevia the Formulas / Define Name menu:And then the formula in B3 is now:
eg: if you still wanted the helper column of 1-period changes:
EDIT:
This alternative formula is a little more flexible, as it allows you to pass in an array with more than one column, using
CHOOSEROWSrather thanINDEX:Using a
LAMBDAalias for theCHOOSEROWSfunction cuts down the typing.