Formatting Issues

Convert Text Dates to Custom Date and Time Format in Excel

Rana GarciaRana Garcia Dec 2, 2026 868 views

Question details

Convert a text date and time into a usable spreadsheet value and display it in a custom format.

Convert Text Dates to a Custom Date and Time Format in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A cell contains text such as Jul 13, 2022, 5:00:00 PM, and the user wants to display it as 7/13/2022 17:00.
Observed behavior
The desired result is a numeric date and time that can be formatted and used in calculations.
Before you start

Check that the source text has two commas, as in Jul 13, 2022, 5:00:00 PM. Use =ISTEXT(A1) to check whether the value in A1 is text, and make sure your regional settings recognize English month names and AM/PM times.

Solution 1Recommended

Convert the text with a formula and apply a custom format

Use this method to create a numeric date and time that Excel can sort and calculate with.

1
Enter the conversion formula

With the text date in A1, select B1 and enter =DATEVALUE(LEFT(A1,FIND(",",A1,FIND(",",A1)+1)-1))+TIMEVALUE(TRIM(MID(A1,FIND(",",A1,FIND(",",A1)+1)+1,99))).

2
Apply the date and time format

Select B1, open Format Cells, choose Number > Custom, and enter m/d/yyyy hh:mm in the Type field. Select OK.

3
Convert the remaining rows

Drag the fill handle from B1 down alongside the other text dates. For the example, the result displays as 7/13/2022 17:00.

Convert the text with a formula and apply a custom format
If the formula returns an error: The formula expects a comma after the day and another after the year. DATEVALUE and TIMEVALUE also depend on regional settings; check that Excel recognizes the source month name and time notation.
Convert dates in WPS Spreadsheets

Convert and format text dates in WPS Spreadsheets

Use a formula in WPS Spreadsheets to turn the text into a numeric date and time, then apply a custom display format.

  1. 1. Open the spreadsheet: Open your workbook in WPS Spreadsheets and locate the text date in A1.
  2. 2. Convert the value: Select B1 and enter =DATEVALUE(LEFT(A1,FIND(",",A1,FIND(",",A1)+1)-1))+TIMEVALUE(TRIM(MID(A1,FIND(",",A1,FIND(",",A1)+1)+1,99))).
  3. 3. Set the display format: Select B1, open Format Cells, choose Custom, and enter m/d/yyyy hh:mm.
  4. 4. Fill other rows: Drag the fill handle down from B1 to convert additional dates in column A.
Convert text dates into values usable in calculationsDisplay dates and times with a custom 24-hour formatOpen and save Microsoft Excel XLSX filesWork with familiar spreadsheet formulas and formatting controls
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't a custom date format change my cell?

A custom format changes the display of a numeric date, not text. Enter =ISTEXT(A1) in another cell to check the source, then convert it to a numeric value before applying the format.

Can I use TEXT to convert the date?

If A1 already contains a numeric date and time, =TEXT(A1,"m/d/yyyy hh:mm") produces the desired display as text. The result is not a numeric date for calculations, and TEXT may not reliably parse an unconverted text date.

How can I tell whether the converted date is numeric?

Enter =ISNUMBER(B1), where B1 contains the conversion formula. TRUE means the result is numeric and can be used in date and time calculations.

Why does DATEVALUE return an error?

Check that the date portion is valid and that your regional settings recognize its month name and order. The conversion formula also expects the source to have a comma after the day and another after the year.