简体   繁体   English

Excel 日期公式 + 3 个月

[英]Excel Date Formula + 3 Months

I am looking to have a formula that takes the date that is manually input in a cell (E2) and automatically populates a date in the column next to it (F2) that is + 3 months from the date manually input in (E2).我正在寻找一个公式,该公式采用在单元格 (E2) 中手动输入的日期,并在它旁边的列 (F2) 中自动填充一个日期,该日期与 (E2) 中手动输入的日期相距 3 个月。

eg.例如。 If (E2) has 03/11/2021 input manually then the formula in (F2) would populate 03/02/2021.如果 (E2) 手动输入 03/11/2021,则 (F2) 中的公式将填充 03/02/2021。 image of part of the sheet工作表的一部分的图像

Is this what you are looking for?这是你想要的?

=DATE(YEAR(A1),MONTH(A1)+X,DAY(A1))

where X = 3其中 X = 3

One can use EDATE() :可以使用EDATE()

=EDATE(A1,3)

The second criteria is the number of Months to add.第二个标准是要添加的月数。

EDATE will go to the number of months then try to equate the day. EDATE 将转到月数,然后尝试将天等同起来。 If the day exceeds the number of days in the target month it returns the last day of the target month.如果日期超过目标月份的天数,则返回目标月份的最后一天。

For example =EDATE(DATE(2021,11,30),3) will return the 28th of February 2021.例如=EDATE(DATE(2021,11,30),3)将返回 2021 年 2 月 28 日。

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

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