Control buffering with IF...THIS

Coordinator
Oct 14, 2011 at 7:36 PM
Edited Oct 14, 2011 at 7:38 PM

Use the idiom IF(Condition, Cell, THIS()) to only buffer Cell when Condition is true.

For example:
A1 =RAND(), B1 =IF(RAND() < 0.2, RAND(), THIS())
B2:B3 =ARRAY.GET(ARRAY.BUFFER(B1, 2))
A3 =IF(B2<>B3, ARRAY.BUFFER(A1:B1), THIS())
A4:B10 =ARRAY.GET(A3)

The random number in B1 is only update 1 in 5 times on average. The buffer in A3 is only called when the update occurs.