ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Contradictory results of DateDiff function (https://www.excelbanter.com/excel-programming/293280-contradictory-results-datediff-function.html)

Pallavi Singh

Contradictory results of DateDiff function
 
Hello,
Could anyone plz point out that what could be the probable reason for
DateDiff function to give different answers for the same set of values.
I am using the following:
DateDiff ( "s", time1, time2)
Here 'time1' is greater than 'time2'. But the DateDiff function
sometimes returns a positive value and sometimes a negative value.
Thanks in advance,
Pallavi



JE McGimpsey

Contradictory results of DateDiff function
 
are you really different results for the same values?

From XL/VBA Help:

If date1 refers to a later point in time than date2, the DateDiff function
returns a negative number.




In article ,
"Pallavi Singh" wrote:

Hello,
Could anyone plz point out that what could be the probable reason for
DateDiff function to give different answers for the same set of values.
I am using the following:
DateDiff ( "s", time1, time2)
Here 'time1' is greater than 'time2'. But the DateDiff function
sometimes returns a positive value and sometimes a negative value.
Thanks in advance,
Pallavi



Pallavi Singh

Contradictory results of DateDiff function
 
Hello,
Sorry for wasting your time, it was a silly mistake. The dates were
different.
Thanks
P
"JE McGimpsey" wrote in message
...
are you really different results for the same values?

From XL/VBA Help:

If date1 refers to a later point in time than date2, the DateDiff

function
returns a negative number.




In article ,
"Pallavi Singh" wrote:

Hello,
Could anyone plz point out that what could be the probable reason

for
DateDiff function to give different answers for the same set of values.
I am using the following:
DateDiff ( "s", time1, time2)
Here 'time1' is greater than 'time2'. But the DateDiff function
sometimes returns a positive value and sometimes a negative value.
Thanks in advance,
Pallavi






All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com