Forum Discussion
Need help calculating the difference between two dates and times
- Dec 01, 2022
HassaanAhmed Calculating with dates and times like this is tricky. you need to introduce the MOD function to take only the decimal part of the date.time value.
By the way, I prefer to calculate with the TIME function when adding hours. See attached.
Note also that the 00:00 hour should always be the last hour for the day. On row 14 you had this hour on September 1.
Riny_van_Eekelen Thanks for the prompt responses!
Attaching the file here for your reference.
Could the reason be that I'm creating the time series by adding the excel decimal value for an hour to the cell above (row 2 and below in columns B and D)? If that's the problem, then can you guide me to a better way of generating a list of dates and times for each hour of every day in a month?
HassaanAhmed Calculating with dates and times like this is tricky. you need to introduce the MOD function to take only the decimal part of the date.time value.
By the way, I prefer to calculate with the TIME function when adding hours. See attached.
Note also that the 00:00 hour should always be the last hour for the day. On row 14 you had this hour on September 1.
- HassaanAhmedDec 01, 2022Copper ContributorThank you! This is exactly what I needed