表格:to_date公式,用于从时间戳获取日期 [英] Sheets: to_date formula to get date from timestamp

查看:183
本文介绍了表格: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)

这篇关于表格:to_date公式,用于从时间戳获取日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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