# TIMEVALUE function in Excel

> 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.

Source: https://spreadsheetpractice.com/functions/timevalue · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on October 30, 2026

## Quick answer

- **What it does:** 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)
- **Available in:** Every current version
- **Category:** [Date functions](https://spreadsheetpractice.com/functions/category/date)
- **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.

## What it does

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. Use it on times imported as text or built with text functions. If the text also contains a date, TIMEVALUE keeps only the time.

## Syntax

`=TIMEVALUE(time_text)`

| Argument | Required? | What it is |
|---|---|---|
| `time_text` | Required | The time as text, such as "1:30 PM". |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| B2 | `=TIMEVALUE(A2)` | 1:30 PM | "1:30 PM" as a real time |
| B3 | `=TIMEVALUE(A3)` | 7:45 AM | 24-hour text works too |
| B4 | `=TIMEVALUE(A4)` | 6:20 PM | Only the time is kept from a date and time |

### The sample sheet

Every formula above runs on this data:

|  | A | B |
|---|---|---|
| 1 | Imported | Result |
| 2 | 1:30 PM | 1:30 PM |
| 3 | 07:45 | 7:45 AM |
| 4 | 1/5/2026 18:20 | 6:20 PM |

## Common mistakes

| What you see | Why, 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 decimal | Format the result as a time. |

## Tips

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

## Related functions

- [TIME](https://spreadsheetpractice.com/functions/time): TIME builds a time from hours, minutes and seconds, such as TIME(13,30,0) for 1:30 PM.
- [DATEVALUE](https://spreadsheetpractice.com/functions/datevalue): DATEVALUE converts a date that is stored as text into a real date that Excel can sort, subtract and format.
- [VALUE](https://spreadsheetpractice.com/functions/value): VALUE converts text that looks like a number into a real number Excel can add, average and compare.

## 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.

## Practice

A graded TIMEVALUE exercise ("Shift lengths from text") is on [the TIMEVALUE page](https://spreadsheetpractice.com/functions/timevalue). It is checked instantly, then re-checked on changed data.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
