Excel - Convert hours in decimal

December 2016



Issue


I have a table with following columns:
- Duration (format [h]: mm: ss)
- Cost_Duration
I need a function that converts the time in a decimal (eg 2:30 in 2.5).

Solution


    A     B      C      D      E
1  8:30 12:00  14:00  16:00  =(B1-A1)+(D1-C1)
2  8:30 12:00  14:00  16:00  =(B2-A2)+(D2-C2)
3  8:30 12:00  14:00  16:00  =(B3-A3)+(D3-C3)
4  8:30 12:00  14:00  16:00  =(B4-A4)+(D4-C4)
5  8:30 12:00  14:00  16:00  =(B5-A5)+(D5-C5)
6 total                      =sum(E1:E5)

All the cells must be formatted as follows:
"h:mm" or "[h]:mm"


Thanks to gbinforme for this tip.

Related :

This document entitled « Excel - Convert hours in decimal » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.