Function Problems

How to Convert HHMM Values to Time and Decimal Hours in Excel

Bushra ParveenBushra Parveen Nov 11, 2026 868 views

Question details

The user needs to convert 4-digit numeric values representing hours and minutes (such as 0930) into recognizable Excel time formats, calculate decimal hours, and accurately sum the total durations.

How to Convert HHMM Values to Time and Decimal Hours in Excel
Product
Excel
Device & OS
not provided
Scenario
During data entry, times are often typed as continuous numbers without colons to save time. These numbers must later be converted for payroll, scheduling, or time-based calculations.
Observed behavior
Excel treats entries like 0930 and 0415 as standard integers (930 and 415) rather than time values, preventing accurate time summation and decimal hour calculations.
Before you start

Ensure your numeric data does not contain decimals, and verify that the last two digits of your HHMM numbers (representing minutes) do not exceed 59 before applying the conversion formulas.

Solution 1Recommended

Use the TEXT Function to Convert to Time and Decimal Hours

The TEXT function is the most efficient method. It easily inserts a colon into a 3- or 4-digit number and converts it to a recognizable time value.

This approach uses the TEXT function to format the number as a string with a colon, and the double unary operator (--) to coerce that text string back into a numeric time value.

1
Select a blank cell

Click on an empty cell next to your HHMM value (for example, click E2 if your data is in D2).

2
Enter the conversion formula

Type the formula =--TEXT(D2,"00\:00") and press Enter. This converts the number into an Excel serial time value.

3
Format as Time

Right-click the result cell, select "Format Cells", go to the "Custom" category, and type hh:mm to display it as a standard time.

4
Calculate decimal hours (Optional)

If you need decimal hours instead of a clock time, use the formula =24*TEXT(D2,"00\:00") and format the cell as General or Number.

Use the TEXT Function to Convert to Time and Decimal Hours
Summing Time Ranges: To sum an entire range of HHMM values at once, use =SUM(--TEXT(D2:D10,"00\:00")) and format the result cell as [hh]:mm to display total hours that exceed 24.
Powerful Spreadsheet Tool

Convert Time Data Easily with WPS Spreadsheet

WPS Office provides a fully compatible Spreadsheet tool that handles all standard Excel functions like TEXT, TIME, and DOLLARDE. You can quickly format, convert, and calculate time values without paying for expensive software.

  1. 1. Open your file in WPS: Launch WPS Spreadsheet and open your existing Excel workbook containing the HHMM data.
  2. 2. Apply the conversion formula: Click an empty cell and enter =--TEXT(D2,"00\:00") next to your numeric data.
  3. 3. Format and drag to fill: Press Ctrl+1 to open Format Cells, apply the "hh:mm" custom format, and drag the fill handle down to convert the entire column.
Fully supports advanced time and date formulas like TEXT, INT, and MOD.100% compatible with Microsoft Excel (.xlsx) formats and documents.Completely free and lightweight alternative for powerful data analysis.
QA img-9

Frequently Asked Questions

Why does summing my converted time values reset after 24 hours?

Standard time formats (like hh:mm) reset to 00:00 after 24 hours because they are designed to display a time of day. To show total accumulated hours that exceed 24, you must apply the custom number format [h]:mm or [hh]:mm to your total cell.

Can I format the original cell to just look like a time instead of converting it?

Yes, you can apply a custom format like 00\:00 to the original cell so an entry of 0930 visually displays as 09:30. However, the underlying value remains the integer 930. Because of this, you still cannot use that cell for accurate time-based calculations without using formula conversion first.

How do these formulas handle 3-digit times like 930 instead of 0930?

The formulas provided automatically handle 3-digit numbers correctly. In the TEXT formula (=--TEXT(D2,"00\:00")), the format forces the number into a 4-character string with leading zeros, so 930 becomes "09:30" before being converted to a valid time.