简体   繁体   中英

Excel issue using datedif function

I have a homework assignment that is to calculate the number of days between dates. It is a simple problem; however the format of the dates in column D are causing issue because of the date function. I am using DATEDIF but I am getting a name error. D is formatted as such =DATE(16,1,6), the E is =TODAY() and the datedif is =DATEDIF(D8,E3,D). Please help. =E3-D8 returns the serial 36548.

You should use:

=DATEDIF(D8,E3,"D")

在此处输入图片说明

Otherwise the D is not a Defined Name.

You're getting the correct value. The number of days between January 6, 1916 ( =DATE(16, 1, 6) ) and January 29, 2016 ( =TODAY() ) is 36,548 days.Your subtraction using =E3-D8 is returning the correct value.

You can do a rough approximation yourself:

 365.25 days per year
x   100 years
=======
36,525 days

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