简体   繁体   中英

Fill a column of every other date between to given dates in Google Sheets

如何让一列动态列出开始日期和结束日期之间的所有其他日期?

this is pretty much universal solution:

=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)))

0

for odd dates use:

=ARRAYFORMULA(FILTER(TO_DATE(ROW(INDIRECT("A"&A2):INDIRECT("B"&B2))),
               ISODD(TO_DATE(ROW(INDIRECT("A"&A2):INDIRECT("B"&B2))))))

for even dates use:

=ARRAYFORMULA(FILTER(TO_DATE(ROW(INDIRECT("A"&A2):INDIRECT("B"&B2))),
              ISEVEN(TO_DATE(ROW(INDIRECT("A"&A2):INDIRECT("B"&B2))))))

0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM