Return to List of Excel Functions

TIMEVALUE Function – Text to Time in Excel, VBA, G Sheets

Download Example Workbook

Download the example workbook

This tutorial demonstrates how to use the Excel TIMEVALUE Function in Excel to convert a time stored as text into a valid time.

TIMEVALUE Main Function

TIMEVALUE Function Overview

The TIMEVALUE Function Converts a time stored as text into the time’s corresponding serial number.

To use the TIMEVALUE Excel Worksheet Function, select a cell and type:

timevalue formula syntax

(Notice how the formula inputs appear)

TIMEVALUE Function Syntax and Inputs:


Function Arguments ( Inputs ):

time_text – The time stored as text. Example “6:00:00”


Convert Time Stored as Text to Time

When working in spreadsheets you might encounter time stored as text.  You can usually identify times stored as text because the times are left-aligned and are proceeded by apostrophes:


These “times” are treated as text and you’ll be unable to work with them like normal times.

One way to convert the text to a date is with the TIMEVALUE Function:



Things to know about the TIMEVALUE Function:

  • TIMEVALUE ignores date information. To convert a date+time stored as text to a number, use the VALUE Function instead. Or use the DATEVALUE function to get the date only.

TIMEVALUE in Google Sheets

The TIMEVALUE Function works exactly the same in Google Sheets as in Excel:

TIMEVALUE Google Sheet



You can also use the TIMEVALUE function in VBA. Type: application.worksheetfunction.timevalue(time_text)

Running the following VBA statements

Range("B2") = TimeValue(Range("A2"))
Range("B3") = TimeValue(Range("A3"))

will create the following output

Vba TIMEVALUE function

For the function arguments (time_text, etc.), you can either enter them directly into the function, or define variables to use instead.

Return to the List of all Functions in Excel