i want to calculate time difference using excel, between two cells containing numbers in format hh:mm:ss,00. a simple subtraction doesn't work. Anyone can help me? thanks
相关问题
- Excel sunburst chart: Some labels missing
- How to account for clock offsets in a distributed
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
相关文章
- Get column data by Column name and sheet name
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- How to prevent excel from truncating numbers in a
- Get POSIX epoch as system_clock::time_point
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- What's the easiest way to create an Excel tabl
If the two cells contain valid time values then a subtraction should work assuming you are subtracting the smaller value from the larger one (Excel doesn't like negative time values unless you use 1904 Date System).
What formula did you try? What result did you get, what result do you expect?
You can use the If function so that you don't get the negative error. Do
Instead of =TEXT(A1-B1)
You can do:
=IF(A1>B1,A1-B1,B
After a long search, found this out.
I know this question is pretty much dead now but I was looking at this earlier while trying to make a good formula to calculate hours worked in an office. Like by hour and minute. What I came up with was this:
This was the formula I used in my hours column in my table to calculate the hours worked from two times, Time Started and Time ended. Notice I had to do the hour and minutes seperately, this is because there are two different functions for these. There is also a function for the seconds in a time, if you include seconds in the inputed time. Adding this into the formula above wouldn't be too difficult.