在两个给定日期之间每隔一天自动填充一次 [英] Auto-populate every second day between two given dates

查看:23
本文介绍了在两个给定日期之间每隔一天自动填充一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用

I'm currently using the formula in this article to auto-populate a column of dates between to given dates:

=ArrayFormula(TO_DATE(row(indirect("A"&A2):indirect("A"&B2))))

How can I tweak the formula to give every second date? Column D in the article would then say:

  • 01/04/2018
  • 03/04/2018
  • 05/04/2018
  • 07/04/2018 ...and so on.

解决方案

It seems like the formula skips a day if the start date is an odd date. Can this be corrected?

=ARRAYFORMULA(FILTER(TO_DATE(ROW(INDIRECT("A"&A2):INDIRECT("B"&B2))),
 MOD(ROW(INDIRECT("A1:A"&COUNTA(TO_DATE(ROW(INDIRECT("A"&A2):INDIRECT("B"&B2)))))), 2)))

这篇关于在两个给定日期之间每隔一天自动填充一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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