Convert Text Times to 12-Hour Format in Excel
Question details
Convert times stored as text into values that can be displayed in 12-hour AM/PM format.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains time entries such as 13:10:00 and 08:00:00 that need to appear in 12-hour format.
- Observed behavior
- Applying a time format does not change the displayed entries, which may be stored as text rather than numeric time values.
Identify the column containing the time entries and choose an empty column for the converted values. The example below assumes the first time is in F2.
Convert text times with TIMEVALUE and apply a 12-hour format
Use this method when changing the cell format alone does not affect the displayed times.
Number formats change how numeric time values appear; they do not convert text into time values.
In an empty cell such as G2, enter =TIMEVALUE(TRIM(F2)) and press Enter. Replace F2 with the first cell containing a text time.
Select G2 and drag its fill handle down alongside the remaining time entries.
Select the converted cells, open Home > Number > More Number Formats, and choose Custom. Enter h:mm:ss AM/PM in the Type box and select OK.
If the formula returns an error, try =TIMEVALUE(TRIM(CLEAN(SUBSTITUTE(F2,CHAR(160)," ")))) in G2 to remove common nonprinting characters and nonbreaking spaces.

Convert text times to AM/PM in WPS Spreadsheet
Use TIMEVALUE in WPS Spreadsheet to convert recognized text times, then apply a custom 12-hour format to the results.
- 1. Open the workbook: Open WPS Spreadsheet and use Open to select your Excel workbook.
- 2. Convert the first time: In an empty cell, enter =TIMEVALUE(TRIM(F2)), replacing F2 with the cell containing the first text time.
- 3. Fill down: Select the formula cell and drag its fill handle down to convert the other entries.
- 4. Format the results: Select the converted cells, open Format Cells, choose Custom, and enter h:mm:ss AM/PM as the format.

Frequently Asked Questions
Why does changing the time format not affect my Excel cells?
The entries may be text rather than numeric time values. In an empty cell, try =TIMEVALUE(TRIM(F2)), then apply a time format to the result.
How do I display seconds and AM or PM in Excel?
Select the numeric time cells, open Home > Number > More Number Formats > Custom, and enter h:mm:ss AM/PM.
What can I do if TIMEVALUE returns an error?
Check that the text is a recognizable time. To remove common hidden characters, try =TIMEVALUE(TRIM(CLEAN(SUBSTITUTE(F2,CHAR(160)," ")))); regional time conventions can also affect recognition.
Can I replace the original text times with the converted values?
Yes. Copy the converted cells, select the destination, and use Home > Paste > Paste Values. Apply the custom time format to the destination if needed.




