TIMEVALUE Function
TIMEVALUE Function
The TIMEVALUE function in Google Sheets converts time data entered as text into a numeric value (a decimal serial value between 0 and 1) that can be used in time calculations. It is useful when you want to calculate the difference (working hours) between clock-in and clock-out time strings exported from an attendance system.
Syntax
=TIMEVALUE(time_string)
- time_string: A text string representing a time (e.g.,
"14:30","2:30 PM","09:15:30") or a cell reference containing such text.
Practical Examples with a Table
This example converts clock-in and clock-out times entered as text into numeric values and calculates total hours worked.
| A (Clock-In - Text) | B (Clock-Out - Text) | C (Clock-In Serial) | D (Clock-Out Serial) | E (Hours Worked) | |
|---|---|---|---|---|---|
| 1 | Clock-In (Text) | Clock-Out (Text) | Clock-In (Number) | Clock-Out (Number) | Hours Worked |
| 2 | 09:00 | 18:00 | =TIMEVALUE(A2) |
=TIMEVALUE(B2) |
=D2-C2 |
| 3 | 10:30 AM | 7:00 PM | =TIMEVALUE(A3) |
=TIMEVALUE(B3) |
=D3-C3 |
- Result in C2:
0.375(9 hours ÷ 24 hours = 0.375) - Result in D2:
0.75(18 hours ÷ 24 hours = 0.75) - Result in E2:
0.375(Formatting the cell as “Duration” or “Time” displays9:00:00)
Common Errors and Precautions
- When
#VALUE!errors occur:- Occurs if you pass non-standard formats such as
"9時30分", full-width colons ("09:30"), or text that cannot be recognized as a time. Times must be separated by standard half-width colons (:).
- Occurs if you pass non-standard formats such as
- When referencing a cell that is already a numeric time:
- Passing a cell already recognized as a numeric time causes a
#VALUE!error. UseTIMEVALUEonly on text data.
- Passing a cell already recognized as a numeric time causes a
- When a date is included:
- If you pass a combined date-and-time string like
"2026/11/24 18:00", the date portion is ignored and only the decimal time portion (0.75) is returned.
- If you pass a combined date-and-time string like
Frequently Asked Questions
Q. Why does TIMEVALUE return a decimal like '0.5'?
A. Google Sheets represents one full day (24 hours) as '1', so times are stored as decimal serial values between 0 and 1. For example, noon (12:00) is half a day, so it displays as '0.5'. Changing the number format to 'Time' displays '12:00:00'.
Q. Can TIMEVALUE convert time strings over 24 hours, such as '25:30'?
A. No. TIMEVALUE represents a time of day from 0:00:00 to 23:59:59, so passing a string over 24 hours will either return an error or wrap around by subtracting 24 hours.