The TIME function in Google Sheets is a powerful tool for converting specified hours, minutes, and seconds into a time value. This function is particularly useful when working with time data for calculations, reporting, or displaying formatted time values in spreadsheets.
Syntax
TIME(hour, minute, second)
- hour: A required parameter that represents the hour component (0-23).
- minute: A required parameter indicating the minute component (0-59).
- second: A required parameter denoting the second component (0-59).
Example #1
TIME(14, 30, 15)
This function call creates a time value for 2:30:15 PM, returning the result 14:30:15 in a standard time format.
Example #2
TIME(9, 0, 0)
This function generates a time value representing 9:00:00 AM, which results in 09:00:00.
Example #3
TIME(23, 59, 59)
By calling this function, it returns the maximum value for time within a day, yielding 23:59:59 as the output.
Error handling
- VALUE!: This error occurs if any of the parameters are non-numeric or contain text instead of numbers.
- NUM!: This error appears when the hour, minute, or second values are outside their valid ranges (hour must be between 0-23, minutes and seconds between 0-59).