自定义函数和重新计算 [英] Custom Functions and Recalculation

查看:210
本文介绍了自定义函数和重新计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义函数,它接受三个范围名称作为输入参数。当这些范围中的单元格值发生变化时,功能输出保持不变。这是平台的一个功能。

是否有任何正确的方法(至今)在Google表格中自定义函数动态重新计算?我知道人们试图将 now()作为一个参数,不管需要如何都可以连续重新计算。 (现在已被新的工作表封锁)有没有人找到一个满意的解决方案?解决方案

正确的做法是将自定义函数重新计算是改变它的一个参数。关于使用NOW()和其他类似的内置函数作为自定义函数的参数,从 Google表格中的自定义函数


自定义函数参数必须为确定性。也就是说,内置的
电子表格函数在每次计算
时返回不同的结果 - 比如NOW()或RAND() - 不允许作为自定义函数的
参数。如果一个自定义函数试图在这些volatile内建函数之一上返回一个基于
的值,它将无限期地显示Loading ...

通过评论 Mogsdad 对此答案:


事实上, (),RAND()或RANDBETWEEN()

引用一个单元格, >

I have a custom function that accepts three range names as input parameters. When values of cells in these ranges change, the function output stays the same. This is a "feature" of the platform.

Is there any proper way (as of yet) to make custom functions in Google Sheets recalculate dynamically? I know people have tried adding now() as a parameter, which used to continuously recalculate regardless of need. (Now blocked in new sheets.) Has anyone found a satisfactory solution?

解决方案

The proper way to make that a custom function to recalculate is to change a parameter of it. Regarding the use of NOW() and other similar built-in functions as paremeters of custom functions, from 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.

From a comment by Mogsdad to this answer:

In fact, rather than "Loading...", this will display an #ERROR!, This function is not allowed to reference a cell with NOW(), RAND(), or RANDBETWEEN()

这篇关于自定义函数和重新计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆