Preskoči na glavno vsebino

Kako pretvoriti časovni niz v čas v Excelu?

Na primer, na delovnem listu imate seznam besedilnih nizov, zdaj pa morate te besedilne nize pretvoriti v čas ali datum in uro, kako ga lahko rešite? Tukaj bom predstavil nekaj trikov za hitro pretvorbo besedilnega niza v čas v Excelu.

Pretvori besedilni niz v čas

Pretvorite besedilni niz v datum in uro


puščica modri desni mehurček Pretvori besedilni niz v čas

Če želite besedilni niz pretvoriti v čas, lahko za rešitev uporabite nekatere formule.

1. Izberite celico in vnesite to formulo = TIMEVALUE (LEVO (A1, LEN (A1) -2) & ":" & DESNO (A1,2)) (A1 je besedilni niz, ki ga morate pretvoriti v čas) in pritisnite Vnesite. Če potrebujete, lahko povlečete ročico za polnjenje v obseg, ki ga potrebujete. Oglejte si posnetek zaslona:
doc-časovni niz-na-čas-1

2. Nato z desno miškino tipko kliknite te izbrane celice in izberite Oblikuj celice iz kontekstnega menija in nato v Oblikuj celice dialog, izberite čas Iz Kategorija seznam pod Število in izberite vrsto časa, ki ga potrebujete.
doc-časovni niz-na-čas-2

3. klik OK, zdaj se besedilni nizi pretvorijo v čas.
doc-časovni niz-na-čas-3

Opomba:

1. Ta formula ne more pravilno delovati, kadar besedilni niz vključuje sekunde, na primer 120158.

2. Če je oblika besedilnega niza 120456P, lahko uporabite to formulo =TEXT(--(LEFT(A1,LEN(A1)-1)),"0\:00\:00")+((RIGHT(A1,1)="P")/2), nato celice formatirajte kot 12-urno uro, ki jo potrebujete. Oglejte si posnetek zaslona:

doc-časovni niz-na-čas-4
doc-časovni niz-na-čas-5

puščica modri desni mehurček Pretvorite besedilni niz v datum in uro

Če vaš besedilni niz vključuje datum in čas, na primer 20141212 0312, lahko za rešitev uporabite malo dolgo formulo.

1. V prazno celico vnesite to formulo =DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))+TIME(MID(A1,10,2),RIGHT(A1,2),0), nato pritisnite Vnesite po potrebi lahko to formulo uporabite za obseg.

2. Nato z desno miškino tipko kliknite izbrane celice in izberite Oblikuj celice iz kontekstnega menija, nato v Oblikuj celice dialog, izberite Datum Iz Kategorija seznama in v desnem razdelku izberite vrsto, ki jo potrebujete.
doc-časovni niz-na-čas-6

3. klik OK. Zdaj lahko vidite besedilni niz, pretvorjen v datum in čas.
doc-časovni niz-na-čas-7

Nasvet.Če želite čas pretvoriti v decimalne ure, minute ali sekunde, poskusite uporabiti Kutools za ExcelJe Pretvori čas kot je prikazano na naslednjem posnetku zaslona. Popolnoma deluje brez omejitev v 30 dneh, prosim prenesite in si zagotovite brezplačno preskusno različico zdaj

V Excelu hitro pretvorite čas v decimalno vrednost

Na primer, imate seznam časa, ki je potreben za pretvorbo v decimalne ure, minute ali sekunde, kako ga lahko hitro in enostavno rešite v Excelu? The Pretvori čas of Kutools za Excel, vam lahko naredi uslugo.   Kliknite za 30-dnevno brezplačno preskusno različico!
doc pretvori čas
 
Kutools za Excel: z več kot 300 priročnimi dodatki za Excel lahko brezplačno preizkusite brez omejitev v 30 dneh.

Najboljša pisarniška orodja za produktivnost

🤖 Kutools AI Aide: Revolucionirajte analizo podatkov na podlagi: Inteligentna izvedba   |  Ustvari kodo  |  Ustvarite formule po meri  |  Analizirajte podatke in ustvarite grafikone  |  Prikličite funkcije Kutools...
Priljubljene funkcije: Poiščite, označite ali identificirajte dvojnike   |  Izbriši prazne vrstice   |  Združite stolpce ali celice brez izgube podatkov   |   Krog brez formule ...
Super iskanje: Več kriterijev VLookup    Multiple Value VLookup  |   VLookup na več listih   |   Nejasno iskanje ....
Napredni spustni seznam: Hitro ustvarite spustni seznam   |  Odvisni spustni seznam   |  Večkrat izberite spustni seznam ....
Upravitelj stolpcev: Dodajte določeno število stolpcev  |  Premakni stolpce  |  Preklop stanja vidnosti skritih stolpcev  |  Primerjaj obsege in stolpce ...
Predstavljene funkcije: Mrežni fokus   |  Pogled oblikovanja   |   Velika vrstica formule    Upravitelj delovnih zvezkov in listov   |  Knjižnica virov (Samodejno besedilo)   |  Izbirnik datuma   |  Združite delovne liste   |  Šifriranje/dešifriranje celic    Pošljite e-pošto po seznamu   |  Super filter   |   Poseben filter (filter krepko/ležeče/prečrtano ...) ...
15 najboljših kompletov orodij12 Besedilo Orodja (dodajanje besedila, Odstrani znake,...)   |   50 + Graf Vrste (Gantt Chart,...)   |   40+ Praktično Formule (Izračunajte starost glede na rojstni dan,...)   |   19 vstavljanje Orodja (Vstavite kodo QR, Vstavi sliko s poti,...)   |   12 Pretvorba Orodja (Številke v besede, Pretvorba valut,...)   |   7 Spoji in razdeli Orodja (Napredne kombinirane vrstice, Razdeljene celice,...)   |   ... in več

Napolnite svoje Excelove spretnosti s Kutools za Excel in izkusite učinkovitost kot še nikoli prej. Kutools za Excel ponuja več kot 300 naprednih funkcij za povečanje produktivnosti in prihranek časa.  Kliknite tukaj, če želite pridobiti funkcijo, ki jo najbolj potrebujete...

Opis


Kartica Office prinaša vmesnik z zavihki v Office in poenostavi vaše delo

  • Omogočite urejanje in branje z zavihki v Wordu, Excelu, PowerPointu, Publisher, Access, Visio in Project.
  • Odprite in ustvarite več dokumentov v novih zavihkih istega okna in ne v novih oknih.
  • Poveča vašo produktivnost za 50%in vsak dan zmanjša na stotine klikov miške za vas!
Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Would love any help with this. I have data that is reported as "1d 01h 01m" representing 1 day, 1 hour, 1 min and I need to be able to represent this as a single number (preferably in # of minutes) any thoughts on how I can convert this string to a number value? Thanks all!
This comment was minimized by the moderator on the site
how to convert 06Hr:11Mi into 06:11
This comment was minimized by the moderator on the site
Hi, abinash kumar, you can remove alpha characters from your time string.
This tutorial can help you:
How to remove alpha characters from cells in Excel?
This comment was minimized by the moderator on the site
how do I convert Date/Time with this text format 08/07/2022 1519
This comment was minimized by the moderator on the site
Hi, Tina, please give me a specific example for explaining and descriping your problem. Thank you.
This comment was minimized by the moderator on the site
Hi there!

I used one of formulas above to convert a time string and it worked beautifully expect for anything that had a format of 1200P. It should convert to 12:00 but instead converts to 00:00. Any thoughts on why or how to fix it?

I used: "120456P, you can use this formula =TEXT(--(LEFT(A1,LEN(A1)-1)),"0\:00\:00")+((RIGHT(A1,1)="P")/2)"

I did not have any seconds in my time string so I deleted the last set of 0's in the formula and it still worked.
This comment was minimized by the moderator on the site
Hi.,I have a query.
I want to convert a duration extracted in a format #h #m #s to duration format so that I can filter it. For example:
My data has a field named Session Duration and the format of the cell is "General" and the cell says "1h 2m 15s". I need to convert this data into 01:02:15 but not in time format but a duration. Is there a way to do that.
This comment was minimized by the moderator on the site
=A1/(24*60) (algebra methods)..hahhaha
then apply time format
This comment was minimized by the moderator on the site
How can I convert 1 Hour 35 Min 25 Sec, stored as a text format into Hour format (hh:nn:ss)?
This comment was minimized by the moderator on the site
Hi, Gabriel, you can try this formula =TIME(LEFT(K4,1),MID(K4,8,2),MID(K4,15,2)) K4 is the cell contains text you want to convert, then format the result as time.
This comment was minimized by the moderator on the site
2h 50m how do i convert into 2:50
This comment was minimized by the moderator on the site
Hi, Ayaan, you can try Find and Replace function, h (blank) replace wth : , m replace with nothing
This comment was minimized by the moderator on the site
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?
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
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
This comment was minimized by the moderator on the site
It is a little complex, sorry I cannot help you. Maybe someone in our forum https://www.extendoffice.com/forum.html can help you if you place the question in it.
This comment was minimized by the moderator on the site
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?
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations