简体   繁体   English

如何在 excel 中自动创建和更新月份日期列表?

[英]How do I automatically create and update month date list in excel?

I would all the dates of the current month to be listed in a column, updated to the next month on the 1st of the month, and no requirement for me to input anything into the system.我会将当月的所有日期列在一个列中,并在当月 1 日更新到下个月,并且不需要我在系统中输入任何内容。 I've played around with multiple IF functions and different date formulas but can't get anything to work.我玩过多个 IF 函数和不同的日期公式,但没有任何效果。

在此处输入图像描述

In your first cell, rebuild the first date of the month by forcing 1 as the date and reusing the year and month of the current date:在您的第一个单元格中,通过强制 1 作为日期并重新使用当前日期的年份和月份来重建该月的第一个日期:

=DATE(YEAR(TODAY()), MONTH(TODAY()), 1)

In the next 30 cells, use and drag this:在接下来的 30 个单元格中,使用并拖动它:

=IFERROR(IF(MONTH(A1+1)=MONTH(A1),A1+1,""), "")

I'm sure there's a cleaner way but I can't be bothered.我敢肯定有一种更清洁的方法,但我不会被打扰。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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