This function returns the serial number (decimal value) representing a time specified by the hour, minute, and second arguments.
Syntax: TIME(hour, minute, second)
Arguments:
- hour (required) – A number from 0 to 32,767 representing the hour.
- Values > 23 are divided by 24, and the remainder is used as the hour.
- Example: TIME(28,0,0) → TIME(4,0,0) (4:00 AM or 0.16667).
- minute (required) – A number from 0 to 32,767 representing the minute.
- Values > 59 are converted into hours and minutes.
- Example: TIME(0,150,0) → TIME(2,30,0) (2:30 AM or 0.1041667).
- second (required) – A number from 0 to 32,767 representing the second.
- Values > 59 are converted into hours, minutes, and seconds.
- Example: TIME(0,0,12011) → TIME(3,20,11) (3:20:11 AM or 0.139016204).
Background:
- When performing time calculations, you may need to break down a time into components (hours, minutes, seconds) and then reconstruct it.
- The TIME() function converts these parts back into a numeric time value (decimal between 0 and 0.99999999, representing 00:00:00 to 23:59:59).
- If the cell format is set to General before entering the function, the result displays as a time.
Examples:
For applications that include standard processing times in hours, minutes, and seconds, you might want to combine these to display a time value. To do this, use the formula
=TIME(standard_hours,standard_minutes,standard_seconds)
The following examples show possible results and exceptions if the 24- hour, 60-minute, or 60-second boundary is exceeded:
- Basic time construction:
- =TIME(5,6,11) → 05:06:11
- =TIME(13,10,0) → 13:10:00
- =TIME(23,45,30) → 23:45:30
- Handling overflow (values exceeding standard limits):
- =TIME(24,15,30) → 00:15:30 (24 hours wraps to 0)
- =TIME(26,30,30) → 02:30:30 *(26 – 24 = 2 hours)*
- =TIME(12,80,10) → 13:20:10 *(80 minutes = 1 hour + 20 minutes)*
- =TIME(12,59,120) → 13:01:00 *(120 seconds = 2 minutes)*
