How to Convert Text to a Time with TIMEVALUE in Excel
Turn text times from a web form into real times with TIMEVALUE, calculate durations, and decode 24-hour codes like 1745.
You will learn to
- Convert a text time into a real time
- Subtract text times to get hours
- Rebuild a text code like 0815 into a time
How it works
When times arrive as text — from a CSV, a web form or copy-pasted email — Excel cannot add or subtract them reliably. TIMEVALUE(time_text) converts text like "2:15 PM", "14:45" or "11:05 am" into a time value (a fraction of a day) that you can format and calculate with.
TIMEVALUE needs a colon. Codes such as "0815" or "1745" must be rebuilt first: =TIMEVALUE(LEFT(A2,2)&":"&RIGHT(A2,2)). Multiply a difference of two times by 24 to get decimal hours.
=TIMEVALUE(B2)