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
Post a Comment