I am working with Excel and I need to convert a time unit like this mm:ss.00 (centiseconds) all to centiseconds. There are some formulas to extract Minutes and Seconds from this format but I dont know how can I have all in sentiseconds!
For example, if we have a time unit 02:02.18 it should return us 6218 centiseconds! but how? :( with which formula or macro?!
Thanks in advance,
Sama
fixer1234
21k1414 gold badges5353 silver badges8585 bronze badges
Sama Ne
migrated from stackoverflow.comJul 5 '13 at 1:42
This question came from our site for professional and enthusiast programmers.
2 Answers
The formula you need to you is of the form
Explanation: Essentially we are dividing a time by one second, converting it to seconds, and then multiplying it by 100 to get the centiseconds.
Note: Make sure the format of your column is a number if the result doesn't work.
A1 is just a placeholder for whatever cell you want to use. Also I believe your conversion is wrong.
If the excel SECOND function returned a floating-point number:
Ready made ipcrf for teacher 1. Generally, if you know how to extract minutes and seconds, creating a formula is very straight forward. You know there are 60 seconds in a minute and 100 centiseconds in a second, the total number of centiseconds should be
However the excel
SECOND() function only returns integers, and there are no functions that return smaller time steps, so it does not work this way.
peanut_butterpeanut_butter
peanut_butter's answer works for me..but you can also do it this way
=A1*8640000
format result cell as number or general The punisher game download.
That works because excel's default 'unit' is the day - you want the number of 'centiseconds' and there are 8640000 of those in one day (24*60*60*100)
barry houdinibarry houdini
10.2k11 gold badge1414 silver badges2121 bronze badges
I need to go from milliseconds to a tuple of (hour, minutes, seconds, milliseconds) representing the same amount of time. E.g.:
10799999ms = 2h 59m 59s 999ms
The following pseudo-code is the only thing I could come up with:
Centiseconds To Minutes
I'm sure it must be possible to do it smarter/more elegant/faster/more compact.
Mads Skjern
Mads SkjernMads Skjern
2,47955 gold badges2727 silver badges3636 bronze badges
9 AnswersAlex WAlex WS To Cs
28.6k77 gold badges6868 silver badges8585 bronze badges
Good question. Yes, one can do this more efficiently. Your CPU can extract both the quotient and the remainder of the ratio of two integers in a single operation. In
<stdlib.h> , the function that exposes this CPU operation is called div() . In your psuedocode, you'd use it something like this:
A less efficient answer would use the thbthb
/ and % operators separately. However, if you need both quotient and remainder, anyway, then you might as well call the more efficient div() .
9,11233 gold badges2525 silver badges5858 bronze badges
Maybe can be shorter an more elegant. But I did it.
bheatcokerbheatcoker
Valentino RuValentino Ru
2,21699 gold badges2929 silver badges6262 bronze badges
This is on groovy, but I thing that this is not problem for you. Method work perfect.
Kaloian TodorovKaloian Todorov
Kaloian TodorovKaloian Todorov
Hanske1967Hanske1967
Hamish_FernsbyHamish_Fernsby
Just an other java example:
an advantage is that you can simulate shorter days, if you adjust wutzebaerwutzebaer
dayLength
7,5701313 gold badges6161 silver badges130130 bronze badges
Not the answer you're looking for? Browse other questions tagged algorithmdatepseudocode or ask your own question.
A millisecond (from milli- and second; symbol: ms) is a thousandth (0.001 or 10−3 or 1/1000) of a second.[1][2]
A unit of 10 milliseconds may be called a centisecond, and one of 100 milliseconds a decisecond, but these names are rarely used.[3]
Horizontal logarithmic scale marked with units of time
To help compare orders of magnitude of different times, this page lists times between 10−3 seconds and 100 seconds (1 millisecond and one second). See alsotimes of other orders of magnitude.
Examples[edit]
See also[edit]References[edit]
External links[edit]
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Millisecond&oldid=894645357'
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |