Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to convert time string to time in Excel?

For instance, you have a list of text string in a worksheet, and now you need to convert these text strings to time or date and time, how can you solve it? Here I will introduce some tricks for you to quickly convert text string to time in Excel.

Convert text string to time

Convert text string to date and time


arrow blue right bubble Convert text string to time


To convert text string to time, you can use some formulas to solve.

Kutools for Excel, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.

1. Select a cell and type this formula =TIMEVALUE(LEFT(A1,LEN(A1)-2)&":"&RIGHT(A1,2)) (A1 is the text string you need to convert to time) into it, and press Enter. If you need, you can drag the fill handle to the range you need. See screenshot:
doc-time-string-to-time-1

2. Then right click at these selected cells, and select Format Cells from the context menu, and then in the Format Cells dialog, select Time from the Category list under Number tab, then select the time type you need.
doc-time-string-to-time-2

3. Click OK, now text strings are converted to time.
doc-time-string-to-time-3

Note:

1. This formula cannot work correctly when text string including seconds, such as 120158.

2. If your text string format is 120456P, you can use this formula =TEXT(--(LEFT(A1,LEN(A1)-1)),"0\:00\:00")+((RIGHT(A1,1)="P")/2), then format the cells as the 12 hour clock you need. See screenshot:

doc-time-string-to-time-4
doc-time-string-to-time-5


arrow blue right bubble Convert text string to date and time

If your text string includes date and time such as 20141212 0312, you can use a little long formula to solve.

1. In the blank cell, type this formula =DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))+TIME(MID(A1,10,2),RIGHT(A1,2),0), and then press Enter key, if you need, you can apply this formula to a range.

2. Then right click at the selected cells and select Format Cells from context menu, then in the Format Cells dialog, select Date from the Category list, and select the type you need from right section.
doc-time-string-to-time-6

3. Click OK. Now you can see the text string converted to date and time.
doc-time-string-to-time-7

Tip.If you want to convert a time to decimal hours, minutes or seconds, please try to use the Kutools for Excel’s Convert Time as shown in the following screenshot. It’s full function without limitation in 60 days,

Convert Time

Kutools' Convert Time utility can quickly convert a time to decimal hours, minutes, seconds.
doc convert time 1
Time to decimal hours
Time to decimal minutes
Time to decimal seconds
doc convert time 2
doc convert time 3
doc convert time 4


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Ayaan · 2 months ago
    2h 50m how do i convert into 2:50
    • To post as a guest, your comment is unpublished.
      Sunny · 2 months ago
      Hi, Ayaan, you can try Find and Replace function, h (blank) replace wth : , m replace with nothing
  • To post as a guest, your comment is unpublished.
    Syd Azhar · 1 years ago
    using the [ =TEXT(--(LEFT(A1,LEN(A1)-1)),"0\:00\:00")+((RIGHT(A1,1)="P")/2) ] formula,
    in example #2 above, 123706A >> gets converted to 12:37:06 PM (instead of 12:37:06 AM)
    how may this be rectified?
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      You only need to change the P to A in the formula =TEXT(--(LEFT(A1,LEN(A1)-1)),"0\:00\:00")+((RIGHT(A1,1)="A")/2), the format the formula cell as hh:mm:ss AM/PM
      • To post as a guest, your comment is unpublished.
        Syd Azhar · 1 years ago
        so if you enter 35943A you get 3:59:43 AM (which is great).
        but if you enter 123706A you would expect to get 12:37:06 AM but instead you get 12:37:06 PM (which is not so great).
        also if you enter 123706P you get 12:37:06 AM (again expecting to get 12:37:06 PM).
        the meridiem are only incorrect for 12xxxx, formula works flawlessly for 1~11.
        any way to improve the formula, to be all encompassing? thank you
  • To post as a guest, your comment is unpublished.
    Syd · 1 years ago
    using the [ =TEXT(--(LEFT(A1,LEN(A1)-1)),"0\:00\:00")+((RIGHT(A1,1)="P")/2) ] formula,
    in example #2 above, 123706A >> gets converted to 12:37:06 PM (instead of 12:37:06 AM)
    how may this be rectified?
  • To post as a guest, your comment is unpublished.
    heena · 1 years ago
    it is not looking like short cut...I want the short cut for converting the data into time without using mouse
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      Hello, if you need shortcut to convert number string to time, you can hold Shit+Ctrl and press @ keys.