简体   繁体   中英

Convert Day of Year to Calendar Month during a leap year in Excel

Year    Day          Time           TimeStamp
2008    60    3/1    2400    0:00   03/01/2008 00:00

I'm converting DOY to regular calendar month but since 2008 was a leap year the formula I was using for non-leap years does not work. I tried subtracting the formula by 1 but it still gives me the wrong date. Day 60 in 2008 is 02/29/2008.

=A1+41274 for non-leap years (this yields 03/01/2008).

=A1+41273 tried this for the leap year (this yields 02/28/2008).

Excel已经有了一个公式,用于在提到日期和年份时查找日期DATE(Year,1,day)这将返回日期,在您的情况下,它将是DATE(2008,1,60)这将返回29/02 / 2008年

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