This function converts a time formatted as text into a time value (serial number). The serial number is a value in the range of 0 through 0.99999999, corresponding to a time from 00:00:00 through 23:59:59.
Syntax:
TIMEVALUE(time_text)
Arguments:
- Time_text (required): A text value in any Excel time format. Dates in the time argument are ignored.
Background:
If a time is formatted as text (e.g., in imported values), use the TIMEVALUE() function to convert it into a serial number. The result can then be used in other calculations.
Most Excel functions automatically convert text-formatted times into serial numbers. However, with imported data or third-party add-in functions, this may not always happen. To ensure proper conversion, use TIMEVALUE().
Example:
Assume that after importing data, some values appear as text in a time column. To use them in calculations, convert them into numeric time values.
The formula:
=TIMEVALUE(« 06:00:00 »)
returns the time value 0.25 (or 06:00 when formatted as hh:mm). This is a valid time value in Excel’s time system.
Additional examples:
- =TIMEVALUE(« 06:00 PM ») returns 0.75.
- =TIMEVALUE(« 06:45:16 ») returns 0.281435185.
- =TIMEVALUE(« 12:00:00 ») returns 0.5.
