Google Sheet Custom Function Not Recaculating -


hi have read caching issues custom functions in google sheets, i'm trying understand why following update if cell changed:

function doob(input){  return input * 2; } 

but not update:

function doob(input){  var sheet = spreadsheetapp.getactivespreadsheet();  var range = sheet.getrange(input);  var values = range.getvalues();  return values[0][0] * 2 ;  } 

i need range in order use .getbackgroundcolor() of each cell.

probably because in first function pass cellreference directly,

=doob(a1) 

and in script value of cell used. in second, have pass range string (since want backgroundcolors, not after values of range, right ?)

=doob("a1:b8") 

as know, custom functions suffer memoization. work around pass in range second time, without quotation marks.

=doob("a1:b8", a1:b8) 

that second paramater 'dummy' paramater script nothing it. but: change in values in range should make custom function re-evaluate. don't know if gonna lot if final goal backgroundcolors.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -