Calculation Issues

How to Convert Four-Digit Times to Decimal Hours in Excel

Ayan MasoodAyan Masood Nov 10, 2026 868 views

Question details

The user needs to convert four-digit numeric time entries (e.g., 0700, 1530) into decimal hours to accurately calculate elapsed time and handle breaks.

How to Convert Four-Digit Times to Decimal Hours in Excel
Product
Excel
Device & OS
not provided
Scenario
Calculating hours worked or elapsed time using time logs entered as raw 4-digit numbers without colons.
Observed behavior
Directly subtracting 4-digit numbers results in incorrect totals (e.g., 1530 - 0700 = 830 instead of 8.5 hours) because Excel does not natively recognize these as time values.
Before you start

Check your source data to confirm whether your four-digit times are formatted as pure numbers (e.g., 700, 1530) or as text strings. This will determine which formula you need to use.

Solution 1Recommended

Convert Numeric Entries to Decimal Hours Using a Formula

Use a combination of INT and MOD functions to extract the hours and minutes from a 4-digit number and calculate the decimal difference.

This method handles pure numeric entries without needing to alter your raw data manually. It also accounts for breaks and overnight shifts using an IF statement.

1
Select a calculation cell

Select a blank cell where you want to display the total decimal hours.

2
Enter the conversion formula

Input the following formula: =ROUND(((INT(B2/100)+MOD(B2,100)/60)-(INT(A2/100)+MOD(A2,100)/60)+IF(B2<A2,24,0))-(C2/60),2). In this formula, A2 is the start time, B2 is the end time, and C2 is the break duration in minutes.

3
Format the result

Press Enter to apply the formula. Right-click the cell, choose 'Format Cells', and ensure the resulting cell is formatted as a Number with two decimal places.

Convert Numeric Entries to Decimal Hours Using a Formula

Easily Manage Time Sheets and Formulas in WPS Spreadsheet

WPS Spreadsheet fully supports advanced mathematical and text functions like INT, MOD, and REPLACE. You can seamlessly execute complex time tracking and payroll calculations just as you would in Microsoft Excel.

  1. 1. Launch the Spreadsheet module: Open WPS Office and create or open your timesheet in the Spreadsheet module.
  2. 2. Input your time data: Enter or paste your four-digit time data into the appropriate columns.
  3. 3. Apply the calculation formula: Apply the time conversion formula utilizing INT and MOD in an adjacent cell to instantly calculate time.
  4. 4. Adjust cell formatting: Select 'Format Cells' from the right-click menu to adjust your results to a standard Number or Time format.
100% compatible with Microsoft Excel (.xlsx) formats and formulasIncludes dozens of built-in date and time functionsLightweight application that runs smoothly even with large datasetsFree to download and use with a highly familiar user interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel calculate 1530 minus 0700 as 830 instead of 8 hours and 30 minutes?

Because 1530 and 0700 are read as standard numbers, not times. Excel performs regular decimal subtraction (1530 - 700 = 830). To get elapsed time, you must convert these numbers using formulas or insert a colon to format them as actual times.

How do I format a cell to display decimal hours?

Right-click the cell containing your formula result, select 'Format Cells', choose 'Number' from the category list, and set decimal places to 2. Do not use the 'Time' format, as it will try to read your decimal as a fraction of a day.

Why do I need to multiply my time calculation by 24?

Excel stores time as a fraction of a 24-hour day. For example, 12 hours is stored as 0.5. To convert this daily fraction into standard decimal hours, you must multiply the result by 24.

How do I handle overnight shifts when calculating time?

If your end time is smaller than your start time (e.g., starting at 22:00 and ending at 06:00), you can add an IF function to your formula. Using IF(End<Start, 24, 0) in numeric calculations or +1 in time formatting ensures the calculation correctly spans across midnight.