Article updated on October 06, 2007

Problem: How to count time, as in hours, minutes and seconds?


Cells in column A and B are formatted as mm:ss
Row 1: A simple subtration counts the hours and seconds between cell B1 and A1
Row 2: Can time be a negative value? Not in excel
Row 3: We need a IF() formula to be sure time is not negative

Cells in column D are formatted as [t]:mm:ss
Row 5,6 and 7: A subtraction between B5 an A5 results in a decimal value. Value 1 corresponds to one day (24h) To get a value in hours and minutes, format as [t]:mm:ss.

IF(logical_test;[value_if_true];[value_if_false]): Checks wether a condition is met, and returns one value if TRUE, and another value if FALSE