Calculating the number of days between two dates

What is the formula for counting the days between two dates that counts both the starting date and the end date, e.g. Sept. 1 to Sept. 5 comes out as 5 days, not 4.

Thnks

Posted on Sep 6, 2019 11:26 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 7, 2019 12:10 AM

Hi dinkus,


I would go with

=DUR2DAYS(E1−D1)+1

=DATEDIF(D1,E1,"D")+1

works too.

quinn


2 replies

Sep 7, 2019 12:21 AM in response to dinkus8833

When you have $5 in your pocket, and you spend $5 for a note pad, do you then have $1 in your pocket?

It works the same way with dates.


'Dates' in Numbers are recorded as Date and Time values. If only a Date part is entered, the time part is automatically set to 00:00:00 (Midnight, at the beginning of that day).


From midnight at the beginning of September 1, 2019 to midnight at the beginning of September 5, 2019 is four days.

Five full days after any time on September 1, 2019 it is the same time of day on September 6.


A simple subtraction of one date from a later date will return a Duration value which will be automatically formatted as days.

The DATEDIF(start-date,end date) will return a number representing the number of 24 hour days between those dates.


Add 1 to either result (1d to a duration, 1 to a number result) to get the number of days including the start date and the end date.


DATEDIF(B2,C2)+1 where B2 contains the start date and C2 contains the end date.


C2-B2+"1d"            where B2 contains the start date and C2 contains the end date.


Regards,

Barry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Calculating the number of days between two dates

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.