How to calculate the difference in
hours between two datetime values


Excel 2007  Excel 2003  Macros Excel 2007  Macros Excel 2003  Excel 2010 



How to
calculate the difference in hours between two datetime values: One of our website visitors wanted to know how to calculate the time difference in hours between two datetime values in Microsoft Excel. He also wanted to know how to do this using a macro. The problem is quite interesting for scientific experiments as well as for calculating the number of hours worked on a project. How to enter the date and time in a cell:
Sub CalculateHoursFromTwoDateTimesValues() Range("C2").Value = (Range("B2").Value  Range("A2").Value) * 24 End Sub The training video below shows the details of performing the calculations without a macro: 



Excel 2007  Excel 2003  Macros Excel 2007  Macros Excel 2003  Excel 2010 
