Calculation Issues

How to Correct Excel Decimal Hour Calculations with CEILING

Amos GikundaAmos Gikunda Oct 28, 2026 869 views

Question details

The user needs to correct inaccuracies in Excel when calculating time durations and converting them to decimal hours using the CEILING function.

How to Correct Excel Decimal Hour Calculations with CEILING
Product
Excel
Device & OS
not provided
Scenario
Calculating decimal hours for time durations (such as 17:30 to 18:30) and rounding to specific intervals like 15 minutes.
Observed behavior
Floating-point precision errors cause time durations to round incorrectly when converting to decimal hours using the standard CEILING function.
Before you start

Ensure your start and finish time columns are formatted as Time (e.g., h:mm AM/PM) so the formula can correctly interpret the values as fractions of a day.

Solution 1Recommended

Use ROUND and CEILING to Fix Floating-Point Errors

By rounding the duration to the nearest minute before applying the CEILING function, you eliminate floating-point precision errors inherent in time calculations.

Excel stores time as fractions of a 24-hour day. When subtracting times, tiny floating-point discrepancies can occur, causing functions like CEILING to round up unexpectedly.

Multiplying the time difference by 1440 (the number of minutes in a day) and rounding to zero decimal places stabilizes the minute value before you apply the ceiling interval.

1
Select the result cell

Click on the cell where you want the calculated decimal hours to appear.

2
Enter the rounding formula

Type the formula: =CEILING(ROUND(1440*([@[Finish Time]]-[@[Start Time]]),0),15)/60. Replace the column names with your actual cell references if you are not using an Excel Table.

3
Apply the calculation

Press Enter to apply the formula. The duration is now rounded to the nearest minute, forced to the next 15-minute interval, and converted back to decimal hours.

4
Format as a number

Right-click the cell, select Format Cells, choose Number, and set it to two decimal places to view the correct decimal hour (e.g., 1.25).

Use ROUND and CEILING to Fix Floating-Point Errors
Formula Breakdown: 1440 converts the day fraction to minutes, ROUND removes the floating-point error, CEILING rounds up to the nearest 15 minutes, and dividing by 60 converts it back to decimal hours.
Seamless Time Tracking with WPS Office

Calculate Time Accurately with WPS Spreadsheet

WPS Spreadsheet fully supports advanced time calculation formulas, including CEILING and ROUND, allowing you to track hours and payroll without precision errors.

  1. 1. Open your time-tracking workbook: Launch WPS Spreadsheet and open your .xlsx timesheet file.
  2. 2. Select the calculation cell: Click on the cell designated for your decimal hour result.
  3. 3. Input the formula: Type the combined CEILING and ROUND formula to calculate the exact duration.
  4. 4. Drag to apply: Press Enter and drag the fill handle downwards to apply the formula to the rest of your timesheet column.
Fully compatible with Microsoft Excel formulas and .xlsx formats.Built-in time and date formatting tools for accurate payroll tracking.Lightweight and fast, handling large datasets without lag.Free to use with a familiar, user-friendly interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel sometimes calculate 1 hour as 0.999999 hours?

Excel stores dates and times as serial numbers, where one day equals 1.0. Hours and minutes are fractions of this day. Converting these fractions into binary floating-point numbers can cause tiny precision errors, resulting in values like 0.999999 instead of exactly 1.

Can I round to the nearest 30 minutes instead of 15?

Yes. In the formula =CEILING(ROUND(1440*(End-Start),0),15)/60, simply change the number 15 to 30 to round the duration up to the nearest half-hour interval.

How do I handle calculations that cross midnight?

If your end time is past midnight, standard subtraction will result in a negative number. Modify your time difference calculation using the MOD function like this: MOD(End-Start, 1) before applying the ROUND and CEILING functions.