How to Use the TIME function to combine single time parts
The worksheet below shows single time parts in each column. Column B contains hours, column C contains minutes, and column D contains seconds. All three columns have to be combined into one time as shown in column E. To do this, use the TIME function. This function returns the decimal number for a particular
time. The syntax is:
TIME(hour, minute, second)
hour: A number from 0 to 23 that represents the hour. Any value greater than 23 will be divided by 24 and the remainder will be treated as the hour value.
minute: A number from 0 to 59 that represents minutes. Any value greater than 59 will be converted to hours and minutes.
second: A number from 0 to 59 that represents seconds. Any value greater than 59 will be converted to hours, minutes, and seconds.
To combine single time parts into a valid time:
- Select cells E2:E10 and type the formula =TIME(B2,C2,D2).
- Press Ctrl+Enter.
- From the Format menu, select Cells.
- Select the Number tab and click Custom under Category.
- Enter hh:mm:ss as the custom format.
- Click OK.
This tip is compatible with Excel 97, 2000, 2003 and 2007.
