Spreadsheet Practice

TIMEVALUE function

Quick answer

TIMEVALUE converts a time written as text, such as "1:30 PM" or "13:30", into a real time you can add, subtract and format.

Syntax
=TIMEVALUE(time_text)
Most common use
=TIMEVALUE(A2) returns 1:30 PM ("1:30 PM" as a real time)

Use it on times imported as text or built with text functions. If the text also contains a date, TIMEVALUE keeps only the time.

Available in
Every current version
Category
Date functions
Returns
A fraction of a day from 0 to just under 1; #VALUE! if the text isn't a time.
Google Sheets
Works the same in Google Sheets.

Syntax

=TIMEVALUE(time_text)

ArgumentRequired?What it is
time_textRequiredThe time as text, such as "1:30 PM".

Examples

Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.

CellFormulaResultWhat it shows
B2=TIMEVALUE(A2)1:30 PM"1:30 PM" as a real time
B3=TIMEVALUE(A3)7:45 AM24-hour text works too
B4=TIMEVALUE(A4)6:20 PMOnly the time is kept from a date and time

Try it live

This is the sample sheet. Change any number or text, or edit a formula, and the results update.

Show the sample data as a table
ImportedResult
1:30 PM1:30 PM
07:457:45 AM
1/5/2026 18:206:20 PM

Practice TIMEVALUE

Graded instantly, then re-checked on changed data.

Shift lengths from text

Start and end times in A2:B6 were imported as text. In C2, calculate each shift's length in hours. Fill down to C6.

Common mistakes

What you seeWhy, and how to fix it
#VALUE!The text isn't a time Excel recognizes, or the cell already holds a real time. TIMEVALUE wants text.
A decimalFormat the result as a time.

Tips

  • =(TIMEVALUE(B2)-TIMEVALUE(A2))*24 gives the length of a shift in hours from two text times.

Questions

How do I convert text to a time in Excel?

=TIMEVALUE(A2) for text like "1:30 PM", then format the cell as a time.

What does TIMEVALUE return for a date and time?

Only the time part: TIMEVALUE("1/5/2026 18:20") is 6:20 PM.

Answers that use TIMEVALUE

Updated Checked by running: every formula on this page was run by our formula engine on .