简体   繁体   English

year年EOM Excel公式

[英]Leap year EOM excel formula

I am trying to extract one year from this date 29/02/2020 and should be getting this 28/02/2019, but I am getting this 31/03/2019. 我正试图从此日期29/02/2020中提取一年,并且应该在2019年2月28日得到,但是我在得到31/03/2019。 I have the following formula =TEXT(EOMONTH(DATE(YEAR(G1)-1,MONTH(G1),DAY(G1)),0),"DD/MM/YYYY"), can someone tell me what I need to add to this formula so that it takes into account leap years. 我有以下公式= TEXT(EOMONTH(DATE(YEAR(G1)-1,MONTH(G1),DAY(G1)),0),“ DD / MM / YYYY”),有人可以告诉我我需要添加到此公式中,以便考虑that年。

您可以这样吗:

=TEXT(EOMONTH(G1,-12),"DD/MM/YYYY")

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

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