Formatting Issues

How to Format Excel Times with Milliseconds

Algirdas JasaitisAlgirdas Jasaitis Oct 26, 2026 868 views

Question details

The user is trying to display four decimal places for milliseconds in Excel, but the application rejects the custom format code hh:mm:ss.0000.

How to Format Excel Times with Milliseconds
Product
Excel
Device & OS
not provided
Scenario
Applying a custom time format to imported data that contains four or more fractional-second digits.
Observed behavior
Excel rejects the hh:mm:ss.0000 format. The application restricts time format displays to a maximum of three decimal places, and the formatting may also fail if the system's regional settings use a different decimal separator.
Before you start

Verify your computer's regional settings to determine whether your system uses a period (.) or a comma (,) as the default decimal separator, as this affects how custom number formats are read.

Solution 1Recommended

Use the Standard 3-Digit Millisecond Format

Apply the maximum supported decimal precision for time in Excel to successfully format your cells.

Excel is hardcoded to support only up to three decimal places for milliseconds in its time formatting. Even if your imported data contains four or more fractional-second digits, Excel will round the displayed time to three digits.

Attempting to force four digits (like hh:mm:ss.0000) will result in an invalid format error. Using the correct three-digit format resolves the rejection issue while maintaining the highest visual precision Excel allows.

1
Select the target cells

Highlight the cells, rows, or columns containing the time data you want to format.

2
Open the Format Cells dialog

Right-click the selected cells and choose 'Format Cells' from the context menu, or press the shortcut Ctrl + 1.

3
Navigate to Custom formats

In the 'Number' tab, select 'Custom' from the Category list on the left side.

4
Enter the valid format code

In the 'Type' input box, type exactly h:mm:ss.000 and click 'OK' to apply the format.

Use the Standard 3-Digit Millisecond Format
Data Preservation: While Excel only displays three decimal places, it often imports and stores the underlying data with higher precision. Computations will still use the full stored value.
Format Times Easily

Manage Custom Time Formats Seamlessly with WPS Spreadsheet

WPS Spreadsheet offers robust and intuitive cell formatting features, allowing you to easily display milliseconds and manage high-precision data with full support for standard custom formatting codes.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your time data.
  2. 2. Select the time cells: Highlight the cells or the entire column that contains the time values you want to format.
  3. 3. Open Format Cells: Right-click the selected area and choose 'Format Cells' from the context menu, or press Ctrl+1.
  4. 4. Apply custom format: Navigate to the 'Custom' category in the Number tab, enter 'h:mm:ss.000' in the Type box, and click OK.
Fully compatible with Microsoft Excel (.xlsx) formats and standard custom format codes.Lightweight software that handles large datasets with high precision smoothly and quickly.Free to use with a familiar, easy-to-navigate user interface that requires no learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Can I force Excel to display four digits of milliseconds?

No, Excel inherently restricts time format displays to a maximum of three decimal places (milliseconds). If you need to visibly show four decimal places, the data must be formatted and stored as Text rather than a recognizable Time value.

Why does Excel reject the h:mm:ss.000 format code?

If the correct three-digit format is rejected, it usually means your operating system's regional settings use a comma as the decimal separator instead of a period. Try entering h:mm:ss,000 instead.

Will I lose my data precision if Excel rounds the display to three digits?

No. Excel imports and stores the underlying fractional seconds with higher precision even if it only displays up to three digits. Any mathematical calculations performed on those cells will still use the exact stored value.