Vai al contenuto principale

Come convertire la stringa temporale in tempo in Excel?

Ad esempio, hai un elenco di stringhe di testo in un foglio di lavoro e ora devi convertire queste stringhe di testo in ora o data e ora, come puoi risolverlo? Qui introdurrò alcuni trucchi per convertire rapidamente la stringa di testo in tempo in Excel.

Converti la stringa di testo in tempo

Converti la stringa di testo in data e ora


freccia blu freccia destra Converti la stringa di testo in tempo

Per convertire la stringa di testo in tempo, puoi utilizzare alcune formule per risolvere.

1. Seleziona una cella e digita questa formula = TIMEVALUE (LEFT (A1, LEN (A1) -2) & ":" & RIGHT (A1,2)) (A1 è la stringa di testo che devi convertire in tempo) in essa e premi entrare. Se necessario, puoi trascinare la maniglia di riempimento nell'intervallo desiderato. Vedi screenshot:
doc-time-stringa-time-1

2. Quindi fare clic con il pulsante destro del mouse su queste celle selezionate e selezionare formato celle dal menu contestuale, quindi nel file formato celle finestra di dialogo, selezionare Ora dal Categoria elenco sotto Numero scheda, quindi seleziona il tipo di orario che ti serve.
doc-time-stringa-time-2

3. Clic OK, ora le stringhe di testo vengono convertite in tempo.
doc-time-stringa-time-3

Nota:

1. Questa formula non può funzionare correttamente quando la stringa di testo include i secondi, come 120158.

2. Se il formato della stringa di testo è 120456P, è possibile utilizzare questa formula =TEXT(--(LEFT(A1,LEN(A1)-1)),"0\:00\:00")+((RIGHT(A1,1)="P")/2), quindi formatta le celle come le 12 ore di cui hai bisogno. Vedi screenshot:

doc-time-stringa-time-4
doc-time-stringa-time-5

freccia blu freccia destra Converti la stringa di testo in data e ora

Se la stringa di testo include data e ora come 20141212 0312, puoi utilizzare una formula un po 'lunga per risolvere.

1. Nella cella vuota, digita questa formula =DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))+TIME(MID(A1,10,2),RIGHT(A1,2),0)e quindi premere entrare chiave, se necessario, puoi applicare questa formula a un intervallo.

2. Quindi fare clic con il pulsante destro del mouse sulle celle selezionate e selezionare formato celle dal menu contestuale, quindi nel file formato celle finestra di dialogo, selezionare Data dal Categoria elenco e seleziona il tipo di cui hai bisogno dalla sezione a destra.
doc-time-stringa-time-6

3. Clic OK. Ora puoi vedere la stringa di testo convertita in data e ora.
doc-time-stringa-time-7

Tipo.Se vuoi convertire un tempo in ore, minuti o secondi decimali, prova a usare il Kutools for Excel'S Converti tempo come mostrato nello screenshot seguente. È completamente funzionante senza limitazioni in 30 giorni, si prega di scaricare e avere una prova gratuita ora.

Converti rapidamente il tempo in valore decimale in Excel

Ad esempio, hai un elenco di tempo necessario per essere convertito in ore, minuti o secondi decimali, come puoi risolverlo rapidamente e facilmente in Excel? Il Converti tempo of Kutools per Excel, può farti un favore.   Fai clic per una prova gratuita di 30 giorni!
doc convertire tempo
 
Kutools per Excel: con oltre 300 pratici componenti aggiuntivi di Excel, provabili gratuitamente senza limitazioni in 30 giorni.

I migliori strumenti per la produttività in ufficio

🤖 Assistente AI di Kutools: Rivoluziona l'analisi dei dati basandosi su: Esecuzione intelligente   |  Genera codice  |  Crea formule personalizzate  |  Analizzare i dati e generare grafici  |  Richiama le funzioni di Kutools...
Funzioni popolari: Trova, evidenzia o identifica i duplicati   |  Elimina righe vuote   |  Combina colonne o celle senza perdere dati   |   Round senza formula ...
Super ricerca: VLookup a criteri multipli    VLookup a valori multipli  |   VLookup su più fogli   |   Ricerca fuzzy ....
Elenco a discesa avanzato: Crea rapidamente un elenco a discesa   |  Elenco a discesa dipendente   |  Elenco a discesa a selezione multipla ....
Gestore di colonna: Aggiungi un numero specifico di colonne  |  Sposta colonne  |  Attiva/disattiva lo stato di visibilità delle colonne nascoste  |  Confronta intervalli e colonne ...
Funzionalità in primo piano: Messa a fuoco della griglia   |  Vista di progettazione   |   Grande barra delle formule    Gestore di cartelle di lavoro e fogli   |  Resource Library (Testo automatico)   |  Date picker   |  Combina fogli di lavoro   |  Crittografa/decrittografa le celle    Invia e-mail per elenco   |  Super filtro   |   Filtro speciale (filtro grassetto/corsivo/barrato...) ...
I 15 migliori set di strumenti12 Testo Strumenti (aggiungi testo, Rimuovi personaggi, ...)   |   50+ Grafico Tipi (Diagramma di Gantt, ...)   |   40+ Pratico Formule (Calcola l'età in base al compleanno, ...)   |   19 Inserimento Strumenti (Inserisci il codice QR, Inserisci immagine dal percorso, ...)   |   12 Conversione Strumenti (Numeri in parole, Conversione di valuta, ...)   |   7 Unisci e dividi Strumenti (Combina righe avanzate, Celle divise, ...)   |   ... e altro ancora

Potenzia le tue competenze di Excel con Kutools per Excel e sperimenta l'efficienza come mai prima d'ora. Kutools per Excel offre oltre 300 funzionalità avanzate per aumentare la produttività e risparmiare tempo.  Fai clic qui per ottenere la funzionalità di cui hai più bisogno...

Descrizione


Office Tab porta l'interfaccia a schede in Office e semplifica notevolmente il tuo lavoro

  • Abilita la modifica e la lettura a schede in Word, Excel, PowerPoint, Publisher, Access, Visio e Project.
  • Apri e crea più documenti in nuove schede della stessa finestra, piuttosto che in nuove finestre.
  • Aumenta la produttività del 50% e riduce ogni giorno centinaia di clic del mouse!
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