Function Problems

Convert Text Times to 12-Hour Format in Excel

Huma Ashraf ChHuma Ashraf Ch Nov 20, 2026 869 views

Question details

Convert times stored as text into values that can be displayed in 12-hour AM/PM format.

Convert Text Times to 12-Hour Format in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Enter the conversion formula

In an empty cell such as G2, enter =TIMEVALUE(TRIM(F2)) and press Enter. Replace F2 with the first cell containing a text time.

2
Fill the formula down

Select G2 and drag its fill handle down alongside the remaining time entries.

3
Apply the 12-hour format

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.

4
Clean text if conversion fails

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 with TIMEVALUE and apply a 12-hour format
Keep the converted values: To replace the formulas with their results, copy the converted cells and use Home > Paste > Paste Values. Check the results before removing the original text column.
Convert text times in WPS

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. 1. Open the workbook: Open WPS Spreadsheet and use Open to select your Excel workbook.
  2. 2. Convert the first time: In an empty cell, enter =TIMEVALUE(TRIM(F2)), replacing F2 with the cell containing the first text time.
  3. 3. Fill down: Select the formula cell and drag its fill handle down to convert the other entries.
  4. 4. Format the results: Select the converted cells, open Format Cells, choose Custom, and enter h:mm:ss AM/PM as the format.
Convert text times into values that can display AM or PMOpen and edit Microsoft Excel XLSX and XLS filesFill a conversion formula down a columnApply custom time formats to converted cells
microsoft office alternative - wps office

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.