Jul 16, 2003 #1 kitnba MIS Jul 31, 2000 132 HK How can I calculate the date? example : a=01/08/2003 b=02/08/2003 I want to know how to get the result b-a = 1 days? what function I can use in Excel to get it? Thanks
How can I calculate the date? example : a=01/08/2003 b=02/08/2003 I want to know how to get the result b-a = 1 days? what function I can use in Excel to get it? Thanks
Jul 16, 2003 #2 ttmac Technical User Aug 16, 2002 105 IE Paste the following into a standard code module: - Function difference(value1 As Date, value2 As Date) As Integer difference = DateDiff("d", value2, value1) End Function To use insert the following into a cell =difference(datevalue 1, datevalue 2) where datevalue is te date you wish to find the difference for Upvote 0 Downvote
Paste the following into a standard code module: - Function difference(value1 As Date, value2 As Date) As Integer difference = DateDiff("d", value2, value1) End Function To use insert the following into a cell =difference(datevalue 1, datevalue 2) where datevalue is te date you wish to find the difference for
Jul 17, 2003 #3 xlbo MIS Mar 26, 2002 15,080 GB Or just = B - A Dates are held as numbers in excel - and 1 day = 1 Therefore 1 hour = 1/24 etc etc so B-A will give you your answer in days Rgds, Geoff Si hoc legere scis, nimis eruditionis habes Want the best answers to your questions ? - then read me baby one more time - faq222-2244 Upvote 0 Downvote
Or just = B - A Dates are held as numbers in excel - and 1 day = 1 Therefore 1 hour = 1/24 etc etc so B-A will give you your answer in days Rgds, Geoff Si hoc legere scis, nimis eruditionis habes Want the best answers to your questions ? - then read me baby one more time - faq222-2244