Formatting Issues

Format Four Digits as a Time with a Colon in Excel

Anum MushtaqAnum Mushtaq Nov 11, 2026 868 views

Question details

The user needs a way to display or convert 4-digit numerical entries (like 502) or text strings (like 0502) into a formatted time value containing a colon (05:02) in Excel.

Format Four Digits as a Time with a Colon in Excel
Product
Excel
Device & OS
not provided
Scenario
Formatting raw numerical data or text representing time into readable standard time formats with colons without manually typing the colon.
Observed behavior
Excel does not automatically convert text strings like 0502 or numbers like 502 into actual time formats containing a colon by default.
Before you start

Determine whether your four-digit entries are stored as numeric values (e.g., 502) or as text strings (e.g., "0502"), as this dictates whether you should use a custom display format or a conversion formula.

Solution 1Recommended

Apply a Custom Number Format to Display as Time

Use Excel's custom formatting feature to display numeric values with a colon without altering the underlying data value.

If you type a number like 502 and simply want it to look like 05:02 on your spreadsheet, you can apply a custom number format. This method is quick and straightforward but keeps the underlying value as a whole number rather than a standard Excel decimal time.

1
Select the target cells

Highlight the specific cells or the entire column containing your numeric four-digit entries.

2
Open the Format Cells dialog

Right-click the highlighted area and select "Format Cells" from the context menu, or press the Ctrl+1 keyboard shortcut.

3
Apply the custom format

Navigate to the "Number" tab, select "Custom" from the Category list, and enter 00\:00 into the "Type" text box. Click "OK" to apply the formatting.

Apply a Custom Number Format to Display as Time
Display Output vs. Real Value: This solution only alters the visual display of the cell. The underlying value will remain the original number (e.g., 502). If you need to perform time calculations, use the formula method instead.
Seamless Data Formatting

Format Numbers as Time Quickly in WPS Spreadsheet

WPS Spreadsheet provides a highly intuitive and fully compatible interface for formatting numeric entries into time values, supporting the exact same custom formats and formulas as Microsoft Excel.

  1. 1. Open your spreadsheet: Launch WPS Spreadsheet and open the document containing your four-digit numeric entries.
  2. 2. Access cell formatting: Highlight your data, right-click, and select "Format Cells" from the drop-down menu.
  3. 3. Set the custom time format: Click on "Custom" in the Number tab, input 00\:00 in the Type field, and hit OK to instantly display your digits with a colon.
Fully compatible with Microsoft Excel custom number formats like 00\:00Perfectly supports complex functions including TIME, LEFT, and RIGHT for data conversionLightweight, free, and designed for efficient data management across all devices
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't formatting 0502 directly as Time work in Excel?

Excel calculates time as a fractional decimal of a 24-hour day. A standard four-digit number like 502 or a text string like "0502" is not recognized as a fraction, so Excel cannot automatically convert it. You must use a custom format string (00\:00) to change its appearance or use a formula to change its actual value.

Can I automatically insert a colon while typing a time?

Yes. If you pre-format an entire column with the custom format 00\:00, you can simply type 0502 and press Enter. The colon will automatically appear, displaying the entry as 05:02.

Can I use VBA to convert these values automatically?

Yes. You can write a Worksheet_Change event macro in VBA that intercepts your four-digit numeric entries as you type them and automatically calculates and replaces them with real decimal time values.