TIMEVALUE function
Overview
TIMEVALUE is a function of the Date and Time category that converts a time stored as text to a serial number corresponding to a time value. The serial number represents time as a decimal fraction of a 24-hour day (e.g., 0.5 represents 12:00:00 noon).
Usage
Syntax
TIMEVALUE(time_text) => timevalue
Argument descriptions
- time_text (text, required). A text string that represents a time in a known format. The text must represent a time between 00:00:00 and 23:59:59.
Additional guidance
- Date information in the time_text argument is ignored. TIMEVALUE processes only the time portion.
- The function can handle various time formats, including both 12-hour and 24-hour formats, as well as text that includes both date and time information.
Returned value
TIMEVALUE returns a number that represents the time as a serial number. The serial number is a decimal fraction of a 24-hour day, where:
- 0.0 represents 00:00:00 (midnight)
- 0.5 represents 12:00:00 (midday)
- 0.99999... represents 23:59:59 (just before midnight)
Error conditions
- In common with many other IronCalc functions, TIMEVALUE propagates errors that are found in its argument.
- If no argument, or more than one argument, is supplied, then TIMEVALUE returns the
#ERROR!error. - If the value of the time_text argument is not (or cannot be converted to) a text value, then TIMEVALUE returns the
#VALUE!error. - If the time_text argument represents a time outside the valid range, then TIMEVALUE returns the
#VALUE!error. - If the time_text argument cannot be recognized as a valid time format, then TIMEVALUE returns the
#VALUE!error. - For more information about the different types of errors that you may encounter when using IronCalc functions, visit our Error Types page.
Links
- See also IronCalc's DATEVALUE function for converting date text to serial numbers.
- Visit Microsoft Excel's TIMEVALUE function page.
- Both Google Sheets and LibreOffice Calc provide versions of the TIMEVALUE function.