Hoppa till huvudinnehåll

Hur konverterar jag millisekunder till tid i Excel?

Som vi alla vet är en sekund lika med 1000 millisekunder mellan tiden förenas, den här artikeln kommer jag att prata om hur man konverterar millisekunder till hh: mm: ss tid i Excel.

Konvertera millisekunder till hh: mm: ss tid med formel


pil blå höger bubbla Konvertera millisekunder till hh: mm: ss tid med formel

För att konvertera millisekunderna till tid kan följande formel göra dig en tjänst:

Ange denna formel i den tomma cellen där du vill skicka resultatet:

=CONCATENATE(TEXT(INT(A2/1000)/86400,"hh:mm:ss"),".",A2-(INT(A2/1000)*1000))och dra sedan påfyllningshandtaget ner till cellerna som du vill använda den här formeln och alla millisekunder i cellerna har konverterats till tid, se skärmdump:

doc konvertera millisekunder till tid 1

Bästa kontorsproduktivitetsverktyg

🤖 Kutools AI Aide: Revolutionera dataanalys baserat på: Intelligent utförande   |  Generera kod  |  Skapa anpassade formler  |  Analysera data och generera diagram  |  Anropa Kutools funktioner.
Populära funktioner: Hitta, markera eller identifiera dubbletter   |  Ta bort tomma rader   |  Kombinera kolumner eller celler utan att förlora data   |   Rund utan formel ...
Superuppslag: Flera kriterier VLookup    VLookup med flera värden  |   VSök över flera ark   |   Fuzzy Lookup ....
Avancerad rullgardinslista: Skapa snabbt en rullgardinslista   |  Beroende rullgardinslista   |  Flervals-rullgardinslista ....
Kolumnhanterare: Lägg till ett specifikt antal kolumner  |  Flytta kolumner  |  Växla synlighetsstatus för dolda kolumner  |  Jämför intervall och kolumner ...
Utvalda funktioner: Rutnätsfokus   |  Designvy   |   Stor formelbar    Arbetsbok & Bladhanterare   |  Resursbibliotek (Automatisk text)   |  Datumväljare   |  Kombinera arbetsblad   |  Kryptera/Dekryptera celler    Skicka e-postmeddelanden efter lista   |  Superfilter   |   Specialfilter (filtrera fet/kursiv/genomstruken...) ...
Topp 15 verktygssatser12 text verktyg (lägga till text, Ta bort tecken, ...)   |   50+ Diagram Typer (Gantt Chart, ...)   |   40+ Praktiskt Formler (Beräkna ålder baserat på födelsedag, ...)   |   19 Införande verktyg (Infoga QR-kod, Infoga bild från sökväg, ...)   |   12 Konvertering verktyg (Siffror till ord, Valutaväxling, ...)   |   7 Slå ihop och dela verktyg (Avancerade kombinera rader, Dela celler, ...)   |   ... och mer

Uppgradera dina Excel-färdigheter med Kutools för Excel och upplev effektivitet som aldrig förr. Kutools för Excel erbjuder över 300 avancerade funktioner för att öka produktiviteten och spara tid.  Klicka här för att få den funktion du behöver mest...

Beskrivning


Fliken Office ger ett flikgränssnitt till Office och gör ditt arbete mycket enklare

  • Aktivera flikredigering och läsning i Word, Excel, PowerPoint, Publisher, Access, Visio och Project.
  • Öppna och skapa flera dokument i nya flikar i samma fönster, snarare än i nya fönster.
  • Ökar din produktivitet med 50 % och minskar hundratals musklick för dig varje dag!
Comments (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Quando eu tento usar a formula, o Excel apresenta um erro como se eu não estivesse querendo fazer uma formula. Estou copiando exatamente a formula original do post
This comment was minimized by the moderator on the site
Hello Matheus,
Sorry to hear that. In Portugal and Spain, commas in the formula should be replaced by semicolons. So the formula should be =CONCATENATE(TEXT(INT(A2/1000)/86400;"hh:mm:ss");".";A2-(INT(A2/1000)*1000)). Please have a try. Look forward to your reply.

Sincerely,
Mandy
This comment was minimized by the moderator on the site
In Excel is easy: =(A2/1000/3600)*"01:00:00"

Set for cell B2 own format number (for 3 decimal places) : hh:mm:ss.000;@
or
Set for cell B2 own format number (for 1 decimal place) : hh:mm:ss.0;@       (Round up for one decimal place)
This comment was minimized by the moderator on the site
In Excel is easy: =(A2/1000/3600)*"01:00:00"
Set B2 format number own (for 3 decimal places) : hh:mm:ss.000;@orSet B2 format number own (for 1 decimal places) : hh:mm:ss.0;@
This comment was minimized by the moderator on the site
Hello ,How are you. I think I know now how to set the format to 3 decimal places or 1 decimal place. Just apply a custom number format to the result. Your advice really helps. Thanks!Sincerely,Mandy
This comment was minimized by the moderator on the site
Hello ,Thank you for your comment. Indeed, your formula is simplier. I enter your formula =(A2/1000/3600)*"01:00:00" into cell B2, and apply the Time format among the number formats. The result format becomes hh:mm:ss. Please see the screenshot. But I can't set the results to 3 decimal places or 1 decimal place. Any way, thank you for your advice.
This comment was minimized by the moderator on the site
Let me rephrase that last question:
"My question here is how do I right the equation so that any number of milliseconds less that 172,800,00 equals the right number of days?"

I meant to type:

My question here is how do I right the equation so that any number of milliseconds more than 172,799,999.00
equals the right number of days?
This comment was minimized by the moderator on the site
This is a very helpful discussion for me. I found Rob Bell's and Jan Hook's previous posts such a great help to the initial tutorial. I needed the additional "day" column to count out my milliseconds which were over the 84,000,000 per day. So I modified Robs easy equation to say, "=TEXT(A1/86400000,"dd:hh:mm:ss.000")." I also used Jan's second equation posted. Funny thing though, on google sheets, when I use the expression on 0ms, the result is 30:00:00:00.000, instead of 00:00:00:00.000. When I try the expression on 1ms, the result is 30:00:00:00.001, instead of 00:00:00:00.001. When I try the expression on 99999999ms, the result is 31:03:46:39.999. When I try the expression on 1111111111ms, the result is 11:20:38:31.111. Notice that all of these except the 1111111111ms begins with a "3", such as 2ms=30:00:00:00.2. It seems to me that strangely the expression "=TEXT(A1/86400000,"dd:hh:mm:ss.000"), and Jan's longer version both result in throwing off the math by exactly 30 days, until the 172,800,000ms, at which time the 30 days drops off, and the expression reports a result of 01:00:00:00.000.

My question here is how do I right the equation so that any number of milliseconds less that 172,800,00 equals the right number of days?
This comment was minimized by the moderator on the site
The simplest/ easiest expression to do this (based on Florian's post below) is =TEXT(A1/8400000,"hh:mm:ss.000")
This comment was minimized by the moderator on the site
You can get the original formula to work by modifying the millisecond portion of the formula to include the text function to format as follows: =CONCATENATE(TEXT(INT(A1/1000)/86400,"hh:mm:ss"),".",TEXT(A1-(INT(A1/1000)*1000),"000"))
If you need to allow for days you can do the following:
=CONCATENATE(TEXT(INT(A1/1000)/86400,"dd:hh:mm:ss"),".",TEXT(A1-(INT(A1/1000)*1000),"000"))
This comment was minimized by the moderator on the site
Hello Jan Hook,Thank you so much for your advice. It helps and corrects the tiny portion of mistakes in our formula. We appreciate your effort and would love to take your advice. Thanks again.Sincerely,Mandy
This comment was minimized by the moderator on the site
Thanks for this all!

=CONCATENATE(TEXT((A1/1000)/86400,"[hh]:mm:ss"))

Is what worked for me as I was looking to round up the milliseconds.

Example of 230947 ms
The original format gave: 00:03:50.947
The format I got rounds up: 00:03:51

Cheers!
This comment was minimized by the moderator on the site
But how do we change the data type into duration. This 100% converts into mm:ss but how do we convert to duration data type
This comment was minimized by the moderator on the site
this produces some errors in some cases (I've not bothered to figure out why or in what cases, but it messed up in about 10% of my rows. Instead, divide the millisecond by 86400000, for example with

=(A1/86400000)

then apply a custom number format to the new value, such as:

[hh]:mm:ss.000

..this worked fine for me in 100% of my rows.
This comment was minimized by the moderator on the site
Hello ,Thank you for your advice. And sorry for the inconvenience. WBest regards,
Mandy
This comment was minimized by the moderator on the site
There's an error in this formula. Note row 6 of the screenshot. 6604545009 should convert to 10:35:45:009. However it the formula incorrectly converts this to 10:35:45:900. 009 vs 900 milliseconds.
This comment was minimized by the moderator on the site
Hello Gautam,Thank you for your comment. You are absolutely right. And we will correct this error soon. Thanks again!Best regards,Mandy
This comment was minimized by the moderator on the site
is this true? Because 79000231 seems to me that this is shorter than 100121211012 but it is longer when you convert it to hh:mm:ss
This comment was minimized by the moderator on the site
Hello Mirjam,How are you. The reason why the shorter 79000231 converts longer results than 100121211012 is that the format dismisses the days. When the format becomes dd/hh/mm/ss, you will see what I mean. Please see the screenshot.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations