Calculation Issues

Calculate the Difference Between Start and End Times in Excel

Natalie TaylorNatalie Taylor Dec 2, 2026 869 views

Question details

Calculate the duration between start and end times and apply the formula across a large worksheet range.

Calculate the Difference Between Start and End Times in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Start and end times are listed in separate columns, and each row needs an elapsed-time calculation.
Observed behavior
The desired result is a duration for each row, displayed in a suitable time format.
Before you start

Check that the start and end entries are recognized as Excel times or date-and-time values, rather than text. If a duration can exceed 24 hours, include the dates in both entries.

Solution 1Recommended

Subtract the Start Time from the End Time

Use a simple formula for times on the same day or for entries that include dates.

1
Enter the formula

With the start time in A1 and the end time in B1, select C1, enter =B1-A1, and press Enter.

2
Fill the range

Select C1 and drag the fill handle down, or enter a range such as C1:C10000 in the Name Box and press Ctrl+D to fill the formula down.

3
Format the durations

Select the result cells, open Format Cells, and choose Custom. Enter [h]:mm:ss to show total hours, including durations longer than 24 hours.

Subtract the Start Time from the End Time
Include dates for longer durations: For intervals spanning multiple days, the start and end cells must include their respective dates as well as times. A time-only value does not identify how many days have elapsed.
Calculate durations in WPS Spreadsheets

Calculate Time Differences in WPS Spreadsheets

Use a subtraction formula in WPS Spreadsheets to calculate elapsed time, fill it down your worksheet, and display total hours.

  1. 1. Open the worksheet: Open your Excel file in WPS Spreadsheets and locate the start and end time columns.
  2. 2. Calculate the difference: If A1 contains the start and B1 contains the end, enter =B1-A1 in C1 and press Enter.
  3. 3. Fill the formula down: Select C1 and drag its fill handle down the rows that need a duration.
  4. 4. Format the results: Select the result cells, open Format Cells > Custom, and enter [h]:mm:ss to display total hours.
Calculate elapsed time for each row with a formulaFill a formula down a large worksheet rangeDisplay durations over 24 hours with a custom formatOpen and edit Microsoft Excel XLSX files
QA img-9

Frequently Asked Questions

How do I show more than 24 hours in an Excel duration?

Select the result cells, open Format Cells > Custom, and use [h]:mm:ss. Include dates in the start and end entries so Excel can calculate intervals spanning days.

What formula should I use for a shift that ends after midnight?

For time-only entries in A1 and B1, use =MOD(B1-A1,1) when the shift is less than 24 hours. Format the result as [h]:mm:ss.

How can I fill the formula down thousands of rows?

Enter the formula in C1, then select the desired range, such as C1:C10000, using the Name Box. Press Ctrl+D to fill the formula down.

Why does Excel show a negative time or hash marks?

The end value may be earlier than the start value, or the column may be too narrow. Check the dates and times, widen the result column, and use =MOD(B1-A1,1) for a time-only interval that crosses midnight and is under 24 hours.