我有一个自定义函数,它接受三个范围名称作为输入参数。当这些范围内的单元格值发生变化时,函数输出保持不变。这是平台的“功能”。
是否有任何正确的方法(到目前为止)使 Google Sheets 中的自定义函数动态重新计算?我知道人们已经尝试添加 now()
作为一个参数,它曾经不顾需要地不断重新计算。 (现在被新的床单挡住了。)有没有人找到满意的解决方案?
最佳答案
使自定义函数重新计算的正确方法是更改它的参数。关于使用 NOW() 和其他类似的内置函数作为自定义函数的参数,来自 Custom functions in Google Sheets
Custom function arguments must be deterministic. That is, built-in spreadsheet functions that return a different result each time they calculate — such as NOW() or RAND() — are not allowed as arguments to a custom function. If a custom function tries to return a value based on one of these volatile built-in function, it will display Loading... indefinitely.
来自 comment来自 Mogsdad这个答案:
In fact, rather than "Loading...", this will display an #ERROR!, This function is not allowed to reference a cell with NOW(), RAND(), or RANDBETWEEN()
关于google-apps-script - 自定义函数和重新计算,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25163243/