简体   繁体   中英

Excel DATEDIF not showing the correct answer

I'm trying to make a calculator that calculates the amount of years, months and days from one date to another. The problem is that the calculation of days not always is accurate, or at least I don't think it is. I have downloaded four age calculators from GooglePlay store, and two of them sometimes give me a different result.

在此处输入图片说明

When I use the dates as shown in the picture some of the two of the calculators give me the answer 6 years, 8 months and 9 days.

The formulas I use is as follow:

C4 =DATEDIF(DATE(C3;E3;F3);DATE(C2;E2;F2);"Y")

E4 =DATEDIF(DATE(C3;E3;F3);DATE(C2;E2;F2);"ym")

F4 =DATEDIF(DATE(C3;E3;F3);DATE(C2;E2;F2);"md")

Is there a way to figure out if my calculation is correct?

Clearly on 22 April 2019 they would be exactly 6 years 0 months 0 days.
Also 22 December 2019 they would be exactly 6 years 8 months 0 days. Starting from there:

在此处输入图片说明

Based on inspection the value of 10 days appears correct.

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