Sheets: to_date formula to get date from timestamp

2019-09-21 07:47发布

enter image description here

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

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'

What am I doing wrong?

2条回答
神经病院院长
2楼-- · 2019-09-21 08:33
=ArrayFormula(to_date(IF(ISBLANK($Q$2:$Q),"",Q2:Q)))

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)

查看更多
何必那么认真
3楼-- · 2019-09-21 08:47

Slightly shorter:

=ARRAYFORMULA(if(Q2:Q="","",to_date(Q2:Q)))
查看更多
登录 后发表回答