Question:
What is the formula to calculate time in excel I need total time from one cell to another?
ssdavis87
2010-11-04 09:15:04 UTC
I am trying to create a time sheet In one cell I have arrival time and the other I have departure time In my third cell I have total time. I am wanting to auto calculate the total time. I have tried several formulas but keep getting an error. If you can help me I would greatly appreicate it. Thanks
Four answers:
gospieler
2010-11-04 10:23:30 UTC
Working with time sometimes it is really tricky, the solution is to FORMAT the cells with a Date-Time format



Second, Excel's default time format does not allow a time value to exceed 24 hours or 60 minutes or 60 seconds and that is why you end up with false results after doing some calculations. There is a workaround:

The common format for time is HH:MM:SS (You have a colon between the HH MM and SS format). To:

• Express a time exceeding 24 hours

Use a format placing brackets around the hour [HH]:MM:SS.

• Express a time exceeding 60 minutes

Use a format placing brackets around the minutes [MM]:SS without the HH format

• Express a time exceeding 60 seconds

Use a format placing brackets around the minutes [SS] without the HH:MM format

HOW TO FORMAT:

Assuming you have a time data on cell A3

• Select the cell A3 and right-click it

• Choose Format Cells.

• In the Format Cells dialog box, click the Number tab.

• From the Category list (left side list) choose Custom

• Type [HH]:MM:SS or other time format into the box labeled Type

(Tip: if you want no seconds then omit the SS format parm)

• Click OK.



After you have define your format you can do any calculation with the data

Remember that changing a cells format does not alter its true underlying value, it only alters the way excel "shows" the value
?
2010-11-04 09:25:47 UTC
About 15 years ago I had to do this. In the end what I had to do was convert the date into a number that represented the date in seconds starting from the year I then converted the time into a number that represented the time in seconds starting at midnight. Add them together. Do the same for the second time. Then do basic math with the seconds. The result will be the difference in the two times. Convert the seconds back into hours and minutes. You end up working with really big number but it's a computer and it can handle it.



Of course if your luck the newer excel actually has a time adding function but I have never used it.
Niefer
2010-11-04 09:39:16 UTC
Why? Assuming arrival time in A1 and departure time in B1, doesn't this simple formula (in C1, for example) work for you?



=a1-b1
IXL@XL
2010-11-04 20:03:09 UTC
A1 start, B1 finish C1 =IF(A1>B1,(1+B1)-A1,B1-A1) format cell as [h]:mm

To SUM multiple time intervals use =SUM(C1:C7) format cell as above.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...