Question about DateDif

MyExcel

Well-known Member
Joined
Sep 25, 2008
Messages
508
when i use the difference Between tow date i add 1
for example
C1 = 1/1/2009
C2 = 15/1/2009
C3 = C2-C1+1
the result = 15
but when i use
DATEDIF(C1,C2,"d") = 14

what is the correct ????
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
Neither is wrong, it just depends on your requirement. I wouldn't use DATEDIF at all for the days difference between two dates, use either

=C2-C1+1

or just

=C2-C1

Let's assume that C1 is today and C2 is tomorrow. If you want the difference to be 2, perhaps because your requirement is from the start of the first day to the end of the latter, then use the first formula

If you think the difference is 1, perhaps measuring from a specific time on one day to the same time on the other, then use tghe second formula
 

Forum statistics

Threads
1,078,239
Messages
5,339,027
Members
399,274
Latest member
WilliamWavehill

Some videos you may like

This Week's Hot Topics

Top