You are missing the fast cache feature . It works as follows:
Google believes that all your custom functions depend only on the parameter values directly, in order to return their result (you can optionally depend on other static data).
Given this assumption, they can evaluate your functions only when changing a parameter. eg.
Suppose we have the text "10" on cell B1, then on some other cell we type =myFunction(B1)
myFunction will be evaluated and its result will be restored. Then, if you change the value of cell B1 to "35", the user will be reevaluated as expected, and the new result will be restored in normal mode. Now, if you again change cell B1 to the original "10", there will be no re-evaluation, the original result will be obtained immediately from the cache.
So, when you use the sheet name as a parameter to dynamically retrieve it and return the result, you break the caching rule.
Unfortunately, you don’t have custom features without this awesome feature. Thus, you will either have to change it to get the values directly, instead of the sheet name, or not use the user-defined function. For example, you might have a script parameter indicating where to summarize the summary, and update their onEdit with every change.
Henrique G. Abreu Jan 26 '12 at 19:21 2012-01-26 19:21
source share