Excel - Convert hours in decimal

October 2017



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.
Published by aakai1056. Latest update on October 3, 2011 at 07:20 AM by aakai1056.
This document, titled "Excel - Convert hours in decimal," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).