表格:to_date公式,用于从时间戳获取日期

表格:to_date公式,用于从时间戳获取日期

问题描述:

我正在将信息从表单发布到Google表格.

I'm posting information from a form to google sheets.

在插入(添加最后一行)之后,我想对一些应用程序脚本进行后期处理.在进行后期处理之前,我想填写几个表格未提交的空白单元格,包括DATE列,该列应从旁边的已提交TIMESTAMP列派生.我正在尝试使用以下公式进行此操作:

After the insert (which adds the last row), I want to do some apps script post processing. Before I do the post processing I want to fill in a couple of blank cells which are not submitted by the form, including the DATE column which should be derived from the submitted TIMESTAMP column next to it. I'm trying to do this with the following formula:

=ArrayFormula(IF(ISBLANK($Q$2:$Q),"",to_date(Q2)))

但是我收到循环依赖项错误"

But I'm getting a 'circular dependency error'

我在做什么错了?

=ArrayFormula(to_date(IF(ISBLANK($Q$2:$Q),"",Q2:Q)))

应该做到这一点.我不明白您是如何得到循环依赖性错误的(在引用同一列时会发生这种情况,例如,上面的公式将所有Q切换为Ps)

Should do the trick. I don't understand how you are getting a circular dependency error (that happens when you are referencing the same column you have your formula in e.g. the formula above switching all Qs for Ps)