It is well-known that Excel's OFFSET function is volatile and will cause recompute and therefore Excel will bother the user with asking to save any loaded file having such function even when the user made no actual changes.
It is also pretty well-known that this can be worked around using non-volatile INDEX function.
So:
=OFFSET($A$1,0,5)
will return a value of F1 cell and it will be volatile=INDEX($A$1,0+1,5+1)
will return a value of the same F1 cell and it will not be volatile
And now let's try to do the same for a range, not a single cell:
=SUM(OFFSET($A$1,0,5,3,1))
will return a sum of values of F1:F3 cells and it will be volatile, as expected- Trying the same with INDEX leads to a surprise in Office 2007:
=SUM(INDEX($A$1:$Z$1000,0+1,5+1):INDEX($A$1:$Z$1000,2+1,5+1))
will return a sum of values of F1:F3 cells but it will be volatile (as confirmed by opening such file and attempting to immediately close it - Excel will ask the user to save the changes).
So, while INDEX()
is non-volatile, using INDEX():INDEX()
to access the range makes the formula volatile, at least in Office 2007.
Is there any other way to access the range at arbitrary offset that would not cause the volatility?
Update: as per @DjC comment, there is no surprise volatility of INDEX():INDEX() in Office 365, but I am looking for a solution that will work for as many prior versions of Office as possible as I need to maintain backwards compatibility at least all the way to Office 2007.
=SUMPRODUCT(A1:Z1000*(ROW(A1:Z1000)<4)*(COLUMN(A1:Z1000)=6))
; however, this will only work if all values in range A1:Z1000 are numbers. Alternatively,SUMIFS()
will work with a single column returned byINDEX()
, for example:=SUMIFS(INDEX(A1:Z1000,,6),criteria_range1,criteria1,...)
. I tested both with Office 2010 and did not get prompted to save when closing immediately after opening.INDEX
had been resolved in O365.=OFFSET($A$1,0,5)+OFFSET($A$1,0,5+1)+OFFSET($A$1,0,5+2)
should do.. right?