Format Four Digits as a Time with a Colon in Excel
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.

- 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.
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.
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.
Highlight the specific cells or the entire column containing your numeric four-digit entries.
Right-click the highlighted area and select "Format Cells" from the context menu, or press the Ctrl+1 keyboard shortcut.
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.

Convert Text Digits to Real Time Values Using the TIME Formula
Use the TIME, LEFT, and RIGHT functions to extract hours and minutes from a text string and convert them into an actual Excel time value.
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. Open your spreadsheet: Launch WPS Spreadsheet and open the document containing your four-digit numeric entries.
- 2. Access cell formatting: Highlight your data, right-click, and select "Format Cells" from the drop-down menu.
- 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.

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.




