Forum Discussion
Value error when subtracting 2 times in dd [hh]:mm:ss format
Hi!
I have been trying to calculate the elapsed time between 2 time stamps in the format of dd [hh]:mm:ss, but I kept getting the value error. I made sure to format the cells before I do my subtraction but it does not seem to work.
Does anyone know why?
- SnowMan55Bronze Contributor
Your custom format is almost self-contradictory: The dd portion indicates that you want to display the day of the month (though it may somewhat work for number of elapsed days), but the [hh] portion indicates that you want to display the number of hours, even if it is 24 or greater.
Your first two columns (timestamps) do not display sufficient information for me to reproduce your displayed values there (in Excel 365).
But I would suggest a custom format of dd hh:mm:ss for the first two columns, and a custom format of [hh]:mm:ss for the third column. See the attached workbook.
A comprehensive guide to Number Formats in Excel - Detlef_LewinSilver Contributor