Convert ISO Date-Time Text to an Excel Date
Question details
Convert ISO date-time text into a numeric Excel date and time that can be formatted, sorted, and charted.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains values such as 2022-02-25T12:31:50.738072 that need to be used as dates and times.
- Observed behavior
- The date-time value is stored as text rather than as a usable Excel date and time.
Check that the source values use the same structure as 2022-02-25T12:31:50.738072, with the date and time in fixed positions. The formula below assumes the first value is in cell A2.
Convert the text with DATE and TIME functions in Excel
Use this formula to create a numeric date and time without relying on Excel to interpret the text's date format.
The formula extracts the year, month, day, hour, minute, and second from fixed positions. It discards fractional seconds and does not apply a time-zone conversion.
Select an empty cell such as B2 and enter =DATE(VALUE(LEFT(A2,4)),VALUE(MID(A2,6,2)),VALUE(MID(A2,9,2)))+TIME(VALUE(MID(A2,12,2)),VALUE(MID(A2,15,2)),VALUE(MID(A2,18,2))). Press Enter.
Select B2, open Format Cells, and choose Custom. Enter yyyy-mm-dd hh:mm:ss as the format, then apply it.
Drag the fill handle from B2 down alongside the source values. Use the converted column for sorting or select it when creating a chart.

Convert ISO Date-Time Text in WPS Spreadsheets
Use a formula and a custom cell format in WPS Spreadsheets to turn fixed-position ISO date-time text into values you can sort and chart.
- 1. Open the spreadsheet: Open WPS Spreadsheets and select the workbook containing the ISO date-time text.
- 2. Enter the formula: If the first text value is in A2, select B2 and enter =DATE(VALUE(LEFT(A2,4)),VALUE(MID(A2,6,2)),VALUE(MID(A2,9,2)))+TIME(VALUE(MID(A2,12,2)),VALUE(MID(A2,15,2)),VALUE(MID(A2,18,2))). Press Enter.
- 3. Format the result: Select B2, open Format Cells, choose Custom, and enter yyyy-mm-dd hh:mm:ss.
- 4. Fill the column: Drag B2's fill handle down to convert the other rows, then use the resulting column for sorting or charting.

Frequently Asked Questions
Why does the converted date appear as a number?
Excel stores dates and times as numeric serial values. Select the result, open Format Cells, and choose a date-time format such as the custom format yyyy-mm-dd hh:mm:ss.
Does the formula retain fractional seconds?
No. It extracts only the whole seconds from positions 18 through 19. Use a different conversion method if subsecond precision is required.
Can I sort the converted values by date?
Yes. Select the converted column and use Excel's Sort command. Because the formula returns numeric date-time values, Excel can sort them chronologically.
Does the formula convert time zones?
No. It uses the date and time shown in the text and does not interpret a time-zone suffix or offset.




