Archive of Mr Excel Message Board
I want to calculate the number of the number of days the occur between the date in cell g6 and e6. I've tried the 360DAYS worksheet function, it didn't work, and I tried DAY(G6)-DAY(E6, which is ok for calculating between 2 dates in the same month, but goes out of wack when a different month is involved in calculation.
I've been trying the following:
=IF(G5="","",DATEDIF((G5),(E5),"D"))
But it gives me a #NUM! error.
Does anyone know how to do this?


The syntax for DATEDIF is:
=DATEDIF(earlier-date,later-date,"d")
"d" makes this function to return the number of days between two dates.
If G5 is expected to house a later date value than E5, use:
=IF(ISNUMBER(G5),DATEDIF(E5,G5,"d"),"")
Aladin
=========== I want to calculate the number of the number of days the occur between the date in cell g6 and e6. I've tried the 360DAYS worksheet function, it didn't work, and I tried DAY(G6)-DAY(E6, which is ok for calculating between 2 dates in the same month, but goes out of wack when a different month is involved in calculation.
