# Sum the number of hours in Excel

I want to sum the total hours I was worked in a project. For each day, I have:

``````Starting Time B1: 09:30:00 am
Ending Time   C1: 17:00:00 pm
Total Hours   D1: =C1-B1 (06:30)
``````

I want to sum the values from column `D` resulting in the total of hours.

Got it! Use the formula `=SUM(D:D)` and Format Cell with the following Custom: `[h]:mm`.

The behaviour of `[h]` is defined here.

`[h]`: Displays elapsed time in hours. If you are working with a formula that returns a time in which the number of hours exceeds 24, use a number format that resembles [h]:mm:ss.

• You're correct. But you're formula is not. I think you meant `=C1-B1` (or your cell-naming is not correct). Either way... if you are a night-dweller and work after midnight you might want to change the formula to `=C1-B1+IF(C1<B1,1)`. In that case if the end-time is after midnight (and smaller than begin-time) there is a day added and your calculation is still correct.
– Rik
Commented Dec 19, 2013 at 9:07