Function Problems

How to Convert Text Dates with Time to Real Excel Date Values

Anum MushtaqAnum Mushtaq Nov 4, 2026 871 views

Question details

The user needs to convert text strings formatted as dates and times into functional serial date-time values that Excel can recognize and compute.

How to Convert Text Dates with Time to Real Excel Date Values
Product
Excel
Device & OS
not provided
Scenario
Importing system data where dates and times (e.g., mm/dd/yyyy hh:mm:ss AM/PM) are pasted or downloaded as text, preventing them from being sorted or calculated properly.
Observed behavior
The spreadsheet application treats the imported date and time data as plain text strings rather than numeric date-time serial numbers, causing errors in time-based calculations and chronological sorting.
Before you start

Ensure your text dates follow a consistent pattern and verify there are no hidden leading or trailing spaces that could interfere with formula extraction.

Solution 1Recommended

Use DATE and TIMEVALUE Formulas for Fixed-Length Dates

Decompose the text string into individual year, month, day, and time components, then rebuild them into a recognized serial value using Excel functions.

This formula approach is ideal when your text dates consistently use two digits for both the month and the day (e.g., 01/09/2021 08:23:50 PM). It uses text-slicing functions (MID, LEFT, RIGHT) to isolate the elements.

1
Select a target cell

Click on an empty cell where you want the converted date and time to appear.

2
Enter the conversion formula

Assuming your text date is in cell B2, type the following formula exactly: =DATE(MID(B2,7,4),LEFT(B2,2),MID(B2,4,2))+TIMEVALUE(RIGHT(B2,11))

3
Calculate the serial number

Press Enter. The cell will display a numerical value representing the Excel date and time serial number.

4
Format as Date and Time

Right-click the calculated cell, choose 'Format Cells', select 'Custom' or 'Date', and apply a format like 'mm/dd/yyyy hh:mm AM/PM' to display the result correctly.

Use DATE and TIMEVALUE Formulas for Fixed-Length Dates
Formula Breakdown: Excel stores dates as whole numbers and times as decimals. The DATE function reconstructs the whole number portion, while TIMEVALUE handles the decimal portion.
Seamless Data Transformation

Convert Text Dates Efficiently in WPS Spreadsheet

WPS Spreadsheet fully supports advanced date and time formulas, as well as powerful data parsing tools. You can effortlessly clean, transform, and format imported text data into valid, calculable values.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the document containing your text dates.
  2. 2. Apply the date formula: In an adjacent column, type your parsing formula (e.g., =DATE(MID(B2,7,4),LEFT(B2,2),MID(B2,4,2))+TIMEVALUE(RIGHT(B2,11))) and press Enter.
  3. 3. Format the result: Right-click the new cell, click 'Format Cells', and select your desired Date and Time format.
  4. 4. Batch convert: Double-click the fill handle in the bottom-right corner of the cell to apply the conversion down the entire column.
100% compatible with Microsoft Excel's DATE, TIMEVALUE, and text-slicing formulas.Built-in 'Text to Columns' wizard for lightning-fast date parsing.Free, lightweight, and features an intuitive interface for managing large datasets seamlessly.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel show my date as a 5-digit number instead of a date?

Excel stores real dates as sequential serial numbers to allow mathematical calculations (e.g., subtracting one date from another). To fix the display, simply right-click the cell, select 'Format Cells', and apply a 'Date' format.

How do I fix a #VALUE! error when using the DATE formula on text?

A #VALUE! error usually indicates that the text string does not match the exact character length expected by the MID, LEFT, or RIGHT functions. Check your data for single-digit days/months or hidden trailing spaces. If your lengths vary, consider using Power Query or the Text to Columns feature instead.

Can I use 'Text to Columns' to fix text dates?

Yes. Select the column of text dates, navigate to Data > Text to Columns, choose 'Delimited', and click Next until Step 3. Under 'Column data format', choose 'Date' (e.g., MDY) and click Finish. This will force the spreadsheet to re-evaluate the text as proper dates.