How to Format Time to Milliseconds in Google Sheets

Many Google Sheets users face challenges when working with time durations that include milliseconds. This is often due to incorrect time formatting. To solve this issue, you must first understand how to format time to include milliseconds in Google Sheets.

In Google Sheets, milliseconds are separated from the seconds field by a dot (.), not a colon (:). If you don’t follow the correct format, the spreadsheet might interpret the entered time as text instead of a valid time value.

The Incorrect Way to Enter Time in Millisecond Format in Sheets

10:45.360

This is an incorrect format. Google Sheets will treat this as a text string. In the example above, the time is entered in the mm:ss.000 format, which is not valid.

Tip: If you’ve already entered time as text (like in the example), you can fix it with a formula workaround. I’ll explain this later in the tutorial.

The Correct Way to Enter Time in Millisecond Format in Sheets

00:10:45.360

This is the correct format. You must include the hours in the format. The correct format is hh:mm:ss.000. Only then will Google Sheets recognize the value as time. However, there is one issue!

While this format ensures the value is treated as time, the milliseconds might be rounded and not visible. You’ll need to adjust the formatting to display them.

Example of milliseconds being rounded or missing in Google Sheets

Below, I explain how to format time values to display milliseconds in Google Sheets.

Steps to Format Time to Milliseconds in Google Sheets

Now that you know how to correctly enter milliseconds in Google Sheets, the next step is to format the time so that the milliseconds are displayed.

Steps:

  1. Select the cell containing the time entered in the hh:mm:ss.000 format.
  2. Go to the menu: Format > Number > Custom number format.
  3. In the field, enter the format hh:mm:ss.000 and click Apply.

This will format the time or duration to include milliseconds in Google Sheets.

Example of formatting time or duration to millisecond format in Google Sheets

Fixing Time Entered as Text

If you’ve entered time in the mm:ss.000 format (treated as text), it can’t be used in time calculations. You can correct this in two ways.

1. Manually Correct Time Text Entries

If there are only a few cells, you can manually edit them. For example:

  • Assume cell A1 contains 45:26.148 (text).
  • Edit it to 00:45:26.148.
  • Then, use the format menu as explained earlier to display the milliseconds.

2. Bulk Convert mm:ss.000 Text to hh:mm:ss.000 Time Format

For multiple cells, use a formula to make corrections.

Example:

Assume time values are in the range A2:A8. This range may contain a mix of text-formatted durations and actual time durations. Enter the following formula in cell B2:

=LET(
   range, A2:A8, 
   ARRAYFORMULA(
      IF(IFERROR(TIMEVALUE(range)), range, IFERROR(("00:"&range)*1))
   )
)

This formula:

  1. Adds 00: to the beginning of each text value in A2:A8 and converts it to a numeric time value.
  2. Retains the original durations for cells already formatted as valid times.
Formula to convert time in text to a numeric value for formatting time to milliseconds

When you use this formula, simply replace A2:A8 with the desired range in your sheet.

How the Formula Works:

  • The IF function evaluates IFERROR(TIMEVALUE(range)).
    • If the cell contains a valid time value, it is retained as is.
    • If the cell contains text, the formula applies IFERROR(("00:" & range) * 1) to convert the text to a time value.

This approach ensures all values in the range are properly formatted for calculations while preserving existing time entries.

Steps to Apply the Corrected Time Format:

  1. Select the formula output range (e.g., B2:B8) and copy it.
  2. Right-click on cell A2, then choose Paste Special > Values Only.
  3. Select the range A2:A8 and apply the format hh:mm:ss.000 as explained earlier.
  4. Delete the formula in B2.

That’s it!

Summary of Tips Learned

In this quick Google Sheets tutorial, you’ve learned:

  1. How to format time to include milliseconds in Google Sheets.
  2. How to convert text-formatted time values to valid time with milliseconds.

If you found this helpful, feel free to share! Thanks for reading.

More Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

How to Extract Numbers from Text in Excel with Regex

You can use the REGEXEXTRACT or REGEXREPLACE functions to easily extract numbers from text...

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

How to Use OFFSET and XMATCH Functions Together in Excel

We often use the OFFSET and XMATCH functions together to match a value in...

How to Calculate Maximum Drawdown in Excel and Google Sheets

You can use the following dynamic array formula to calculate maximum drawdown (MDD) in...

More like this

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

Running Count with Structured References in Google Sheets

Running a count with structured references is achievable in Google Sheets tables using the...

Running Total with Structured Table References in Google Sheets

You can use two types of formulas to create a running total with structured...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.