Custom Function
Posted by Shamsuddeen. P.K. P.K on December 12, 2001 3:54 AM
I have created the following function which calculates the number of days between two given dates:
Function TotDays(EndDate,StartDate)
TotDays = EndDate - StartDate
End Function
The above function is working fine but te problem is that every time I use the function, I have to give the EndDate and StartDate in either of the following formats:
=TotDays(DATE(2001,12,31), DATE(2001,6,15) or
=TotDays(DATEVALUE(12-31-2001"),DATEVALUE("6-15-2001"))
In the above function, I want to give the dates in a simplified way such as :
=TotDays(31-12-2001, 15-6-2001) and the function should convert the dates to the required format and calculate the number of days.
Any help !!!!
Regards,
Shamsuddeen. P.K