I was looking at a previous post and they used the cell input as follows
=ARRAYFORMULA(SUM(TIME(LEFT(B2:B3,2), MID(B2:B3,4,2), RIGHT(B2:B3,2))))
And it works to a point. But the numbers don't roll over correctly.
For instance if I have the following (note: the numbers are in the weird format to make the equation work).
10.55.99
10.20.12
21:16:51 From the equation
21:16.11 What is should actually be
Is there any way to have this work correctly? Or maybe some other way where I could pull apart the original input and process it outside of being a time?
Best Answer
I miss read your question at first, that's why I gave this answer:
Because in the normal
TIME()
function, milliseconds aren't accounted for.What I didn't notice, was the exact notation you're interested in: mm:ss.SSS. This requires a bit of a different approach.
First, you need to calculate the text values to milliseconds, like below:
Formula
Secondly, you need to format the time to
mm:ss.SSS
. There you need to use a little bit of Google Apps Script, to do the formatting like this:Code
Screenshot
Note
This solution is tailor-made towards the
mm:ss.SSS
notation. The advantage is that every entry is seen as a text entry (because the format isn't recognized). A slight disadvantage is the usage of the script (add script under Tools>Script editor, press bug button, authenticate script).There is yet another way to perform this calculation, but it starts by using this notation:
mm:ss:SSS
. Advantage is that no script is used. Disadvantage would be that all entries are recognized as time and converted accordingly. Therefore you need to either set the format in advance or start the entry with a single quote. See reference for complete solution by Ahab on the Google ForumReference
https://productforums.google.com/d/msg/docs/o9xvG4gYeIc/fBi6ZgrEbfYJ