Function Problems

How to Convert Text Like '19 min 3 sec' to Time in Excel

Bushra ParveenBushra Parveen Nov 11, 2026 868 views

Question details

The user needs to transform text strings formatted as 'X min Y sec' into standardized Excel time values or a pure decimal number representing total minutes.

How to Convert Text Like '19 min 3 sec' to Time in Excel
Product
Excel
Device & OS
not provided
Scenario
Data cleaning and time-based calculations.
Observed behavior
Time duration data is stored as unstructured text, preventing users from performing mathematical calculations or applying standard time cell formatting.
Before you start

Ensure your text strings follow a consistent spacing and naming pattern (e.g., '# min # sec') before applying the formulas, as inconsistencies can lead to #VALUE! errors.

Solution 1Recommended

Convert Text to a Standard Excel Time Value

Use a combination of the TIME, LEFT, FIND, and MID functions to extract numeric characters and construct a recognizable time format.

This method locates the positions of 'min' and 'sec' in your text string, pulls out the exact numbers associated with them, and uses the TIME function to compile them into hours, minutes, and seconds. Because hours are missing in the original text, the formula defaults to 0 hours.

1
Enter the Extraction Formula

Select an empty cell next to your text data (for example, B1). Type the formula: `=TIME(0,LEFT(A1,FIND(" min",A1)-1),MID(A1,FIND(" min",A1)+5,FIND(" sec",A1)-FIND(" min",A1)-5))` and press Enter.

2
Format the Result as Time

Right-click the result cell and select 'Format Cells'. Navigate to the 'Custom' category and enter `[h]:mm:ss` or `mm:ss` to display the extracted time correctly.

Convert Text to a Standard Excel Time Value
Formatting Tip: Using the `[h]:mm:ss` custom format ensures that if your cumulative minutes exceed 60, Excel will properly calculate and display the total hours.
Free Data Cleaning Solution

Process Time Data Effortlessly with WPS Spreadsheet

WPS Spreadsheet provides robust data calculation tools and fully supports standard Excel formulas like TIME, FIND, and MID, allowing you to clean unstructured text seamlessly.

  1. 1. Open Your Dataset: Launch WPS Spreadsheet and open the document containing your text-based time strings.
  2. 2. Apply the Formula: Select an empty adjacent cell and paste the TIME extraction formula provided in the recommended solution.
  3. 3. Apply Cell Formatting: Right-click the cell, select 'Format Cells', and apply a custom time format such as [h]:mm:ss.
  4. 4. Drag to Fill: Click and hold the fill handle at the bottom right of the cell, then drag downwards to apply the time conversion to the rest of your data.
100% compatible with Microsoft Excel formulas and cell formattingAdvanced text-to-columns and data extraction tools built-inLightweight and runs quickly even with massive datasetsFree to use across Windows, Mac, iOS, and Android
microsoft office alternative - wps office

Frequently Asked Questions

Why does my formula return a #VALUE! error when converting text to time?

A #VALUE! error usually occurs if the text string does not perfectly match the expected pattern. For instance, if there are double spaces, misspellings like 'mins' instead of 'min', or missing seconds data. You can use the TRIM function to remove extra spaces before extracting.

How do I sum up the converted times across multiple rows?

Once you have successfully converted the text into valid Excel time values using the TIME function method, you can add them together using the standard =SUM() function. Make sure the cell containing the total is formatted with the custom format [h]:mm:ss so it can display sums that exceed 24 hours without rolling over.

Can I use the SUBSTITUTE function instead of FIND and MID?

Yes. A simpler alternative if your data format is extremely consistent is replacing text labels with time delimiters. You can use a formula like =TIMEVALUE(SUBSTITUTE(SUBSTITUTE(A1,"min",":"),"sec","")), provided it outputs a standard "HH:MM:SS" recognizable string.