The TIMEVALUE function in Google Sheets is a powerful tool used to convert a time represented as text into a numeric value. This numeric value reflects the fraction of a 24-hour day that the specified time corresponds to, making it easy to perform calculations or comparisons with other time values.
Syntax
TIMEVALUE(time_text)
- time_text: This is the time in text format that you want to convert into a numeric value. It can be in formats like “HH:MM AM/PM” or “HH:MM”.
Example #1
TIMEVALUE("2:30 PM")
This function converts the text “2:30 PM” into a numeric value representing the fraction of the day. The output would be 0.6041666667, which corresponds to 2:30 PM.
Example #2
TIMEVALUE("6:45")
Here, the function takes the text “6:45” and converts it to a numeric value. The result will be 0.28125, representing 6:45 AM.
Example #3
TIMEVALUE("12:00 AM")
This function call converts “12:00 AM” into a numeric value, yielding 0, which indicates the start of the day.
Error handling
- VALUE! This error occurs when the input time_text is not in a format that Google Sheets recognizes as a valid time. Check the input and ensure it’s in a proper format.
- NUM! This error indicates that the function has received a number that cannot be interpreted as a valid time. Reassess the input provided to the function.