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
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
Hi dinkus,
I would go with
=DUR2DAYS(E1−D1)+1
=DATEDIF(D1,E1,"D")+1
works too.
quinn
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
Calculating the number of days between two dates